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.
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.
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.
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).
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.
Antonio Linares wrote:This seems a good candidate:
https://code.google.com/p/sumatrapdf/
AFAIK, we already talked something about it...
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.
Reinaldo,
have you done some research about MuPDF ?
I have not reviewed it yet
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
//----------------------------------------------------------------------------//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.
Otto,
Very clever workaround, congratulations ![]()