Thx for the tip.  However Envice is GPLd to constrain its use.

cheers -ben

On Mon, Nov 6, 2017 at 2:16 AM, Andrew Glynn <aglyn...@gmail.com> wrote:

> Evince is pretty easy to embed.
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> *From: *teso...@gmail.com
> *Sent: *Sunday, November 5, 2017 10:25 AM
> *To: *Any question about pharo is welcome <pharo-users@lists.pharo.org>
> *Subject: *Re: [Pharo-users] Embedded PDF viewer?
>
>
>
> Hello Ben,
>
>    UFFI does not allow you to call static libraries. Static libraries are
> not executable per se, they need to be linked in another program.
>
> As I know, the only way of using an static library from Pharo is to:
>
>   - Build a plugin that wraps it.
>
>   - Build a DLL exposing all the functions in the library and then they
> are used through UFFI.
>
>
>
> The second option is the easiest to me, but it depends how the library is
> built up. For example, if the library uses a lot of compile time code
> generation (like macros or templates) making a generic DLL is not so easy.
>
>
>
> I think it is better to see if not other project has already tackle this
> problem when using the desired static library.
>
>
>
> Cheers,
>
> Pablo
>
>
>
> On Sun, Nov 5, 2017 at 1:39 PM, Ben Coman <b...@openinworld.com> wrote:
>
> I'm looking into calling PDFium from Pharo via FFI.
>
> Currently I'm stalled a bit since it doesn't have a shared-library target.
>
>
>
> If you consider access to such a library would be useful to the community,
>
> please take a few moments to star this issue...
>
> https://bugs.chromium.org/p/pdfium/issues/detail?id=826
>
>
>
> cheers -ben
>
>
>
>
>
> P.S. Can anyone comment on calling into a static library via FFI?
>
>
>
>
>
>
>
> On Wed, Oct 11, 2017 at 2:05 PM, Ben Coman <b...@openinworld.com> wrote:
>
>
>
>
>
> On Wed, Oct 11, 2017 at 2:03 PM, Ben Coman <b...@openinworld.com> wrote:
>
>
> > On Tue, Oct 10, 2017 at 8:58 PM, Manuel Leuenberger
> > <leuenber...@inf.unibe.ch> wrote:
> > > Hi,
> > >
> > > I want to view a PDF within Pharo. I found that Athens has a PDF
> canvas, but I have no idea how to use it. Is there a way to view a PDF
> within Pharo, so that I can scroll, zoom, click links etc. in the PDF?
> > >
> > > Cheers,
> > > Manuel
>
>
> On Wed, Oct 11, 2017 at 3:04 AM, Stephane Ducasse <stepharo.s...@gmail.com>
> wrote:
> >
> > Hi manuel
> >
> > So far I do not know if we have this is Pharo.
> > I imagine that we would have to build a renderer once we will have the
> > PDF reader from Christian library.
> >
> > Stef
>
>
>
> [Edit: Update license link]
>
>
>
> A renderer will have great synergy with PDFTalk, but I think a proof of
> concept can be done independently.
> I've been poking at this topic for a while looking for options.
> Coincidentally a couple of days I discovered the PDFium library.
>
> I haven't had time yet to give it a run, but it seems a good candidate
> since...
> * Its a successful commercial product by Foxit built into Chrome converted
> to open source with Google's backing for use in Chromium
>        https://www.foxitsoftware.com/company/press.php?id=305
> * Its license is BSD style
>        *https://github.com/hfiguiere/pdfium/blob/master/LICENSE
> <https://github.com/hfiguiere/pdfium/blob/master/LICENSE>*
> * Although written in C++ it has a C interface
>       https://github.com/hfiguiere/pdfium/blob/master/public/fpdfview.h
>       * Search here on  " Function: "  to skim through
>       * Proof of concept seems to only need these key functions...
>           * void    FPDF_RenderPageBitmap( FPDF_BITMAP bitmap,FPDF_PAGE
> page, ... )
>           * FPDF_BITMAP    FPDFBitmap_Create( int width, int height, int
> alpha);
>           * FPDF_PAGE   FPDF_LoadPage   ( FPDF_DOCUMENT document, int
> page_index )
>           * FPDF_DOCUMENT   FPDF_LoadMemDocument   ( const void* data_buf
> ... )
>           * void    FPDF_InitLibrary ()
> * Has a concise getting started for POC...
>
>       https://github.com/hfiguiere/pdfium/blob/master/docs/
> getting-started.md
> * Maybe useful fork with V8 disabled by default
>
>       https://github.com/klokantech/pdfium
>
> * Master repo here
>       https://pdfium.googlesource.com/pdfium/
>
> So Pharo might load a PDF file into a ByteArray, pass that to
> FPDF_LoadMemDocument() & FPDF_LoadPage(),
>
> then get a bitmap back from FPDFBitmap_Create() & FPDF_RenderPageBitmap()
> and display the result in a Pharo window.
>
>
>
> The rest of this week I'm working 12 hour days on a mine site.  I could
> try it out once I'm home, but in the meantime is anyone else keen to try
> it?
>
>
> cheers -ben
>
>
>
>
>
>
>
>
>
> --
>
> Pablo Tesone.
> teso...@gmail.com
>
>
>

Reply via email to