FW pdf viewer?

FW pdf viewer?

Postby reinaldocrespo » Mon Apr 29, 2013 11:02 pm

Is there a fw pdf viewer I can use?

The idea is to be able to quickly preview or even show a pdf inside a fw window or dialog.


Thank you,


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 972
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: FW pdf viewer?

Postby nageswaragunupudi » Tue Apr 30, 2013 4:17 am

Right now only way is to find an external OCX that can show PDF in an activex and use Activex capabilities of FWH/(x)Harbour

If you have any other ideas, welcome.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FW pdf viewer?

Postby Otto » Tue Apr 30, 2013 6:19 am

********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: FW pdf viewer?

Postby Antonio Linares » Tue Apr 30, 2013 8:03 am

FWH provides its own Class FWPdf for PDFs management, though still is very limited in functionality but it is the one that we use to export FWH print preview metafiles to PDFs :-) It is implemented in prv2pdf.prg but it is declared as a static class so can't be used outside that PRG unless "static" is removed.

It has been developed by Rao from scratch and we plan to keep enhancing it :-)

The idea is not having to use an external PDFs lib (if possible).
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FW pdf viewer?

Postby Antonio Linares » Tue Apr 30, 2013 8:25 am

I think that Haru PDF is a good choice and there are already wrappers in Harbour contribs developed by Pritpal:

http://libharu.sourceforge.net/

Documentation:
https://github.com/libharu/libharu/wiki

This may also help to understand it:
http://php.net/manual/en/book.haru.php

Anyhow, we may enhance ours or use haru, surely we may do both things :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FW pdf viewer?

Postby Antonio Linares » Tue Apr 30, 2013 8:32 am

Here there is a free pdf viewer that we could use:

http://www.win8pdf.com/pdf-preview.html
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FW pdf viewer?

Postby nageswaragunupudi » Tue Apr 30, 2013 10:53 am

Finally we come back to this point. We still need to use a third party viewer, either priced or free.

We have tools and (x)harbour libs to write pdfs (again subject to limitation of font data) but not native viewer.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FW pdf viewer?

Postby Antonio Linares » Tue Apr 30, 2013 10:59 am

This seems a good candidate:

https://code.google.com/p/sumatrapdf/

AFAIK, we already talked something about it...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FW pdf viewer?

Postby nageswaragunupudi » Tue Apr 30, 2013 11:07 am

Antonio Linares wrote:This seems a good candidate:

https://code.google.com/p/sumatrapdf/

AFAIK, we already talked something about it...


Yes, in these forums.

Hope we develop our own pdf viewer soon, though may not be right at this moment.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FW pdf viewer?

Postby Antonio Linares » Tue Apr 30, 2013 1:18 pm

Sumatra is based on MuPDF:

http://mupdf.com/

The problem with Sumatra is that they don't deliver a DLL neither a library to use it.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FW pdf viewer?

Postby reinaldocrespo » Tue Apr 30, 2013 1:37 pm

Hi everyone,

Producing a pdf is one subject. Being able to preview it natively is different problem. Neither of these problems have a perfect solution. So far to produce a pdf the best alternative I have used is Image2Pdf from Utility Warrior. You do have to deliver a single .dll, but it works really well.

Now, to preview a pdf, there is simply no alternative other than an ocx that needs to be installed on each pc. I tried Sumatra as well as many others. Sumatra, in particular, consumes all available memory and after a while it simply becomes unstable. All this just tells me that we don't really have any solution to reliably view pdfs on a fw dialog and that is a problem indeed.

Reinaldo.
User avatar
reinaldocrespo
 
Posts: 972
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: FW pdf viewer?

Postby Antonio Linares » Tue Apr 30, 2013 1:50 pm

Reinaldo,

have you done some research about MuPDF ?

I have not reviewed it yet
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FW pdf viewer?

Postby Otto » Tue Apr 30, 2013 2:39 pm

Reinaldo,
this is a workaround but working fine for me.
Best regards,
Otto

http://www.atzwanger-software.com/fw/pdfviewer/pdfviewer.html


Code: Select all  Expand view

function PdfToJpeg( cPDF )
   local cExe     := "c:\Tracker Software\PDF Viewer\PDFXCview.exe"
   local cTitle   := cFileNoExt(  LFN2SFN(  cPDF ) ) //+ " - PDF-XChange Viewer"
   local cCmd
   local hWnd, hBmp, hBmp2, hDib, cBuf, nWait := 2
   local lRet  := .f.

   if File( cExe ) .and. File( cPDF )
      cCmd  := cExe + ' /A "fullscreen=yes"' +  ' ' +  LFN2SFN(  cPDF )
      //cCmd  := cExe + ' /A "Zoom=150"' +  ' ' + cPDF
     
      WinExec( cCmd )
      SysWait( 3 )
     
      do while nWait < 12 .and. Empty( hWnd :=  FindWnd( cTitle ) )
         SysWait( nWait )
         nWait    += 1
      enddo
      if ! Empty( hWnd )

         SetFocus( hWnd )
         SetForeGroundWindow( hWnd )
         SysRefresh()
         SysWait( 0.1 )

         hBmp   := WndBitmap( hWnd )
         SendMessage( hWnd, WM_CLOSE )

         hBmp2             := BmpTrim( hBmp )
         DeleteObject( hBmp )

         hDib              := DibFromBitmap( hBmp2 )
         cBuf              := DibToStr( hDib )
         GlobalFree( hDib )
         DeleteObject( hBmp2 )

         lRet              := BmpBufToJpg( cFileSetExt( cPDF, "jpg" ), cBuf )
         cBuf              := nil
      endif
   endif

return lRet

//----------------------------------------------------------------------------//
 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: FW pdf viewer?

Postby reinaldocrespo » Tue Apr 30, 2013 2:52 pm

Otto;

Thank you. I like your workaround. I will try it. However, it seems like I will only be able to preview the 1st page on a pdf. Still, I like it. I also need to take a look at mupdf as it seems like it is possible to construct a native pdf viewer.


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 972
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: FW pdf viewer?

Postby Antonio Linares » Tue Apr 30, 2013 2:59 pm

Otto,

Very clever workaround, congratulations :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 64 guests