FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWSavePreviewToPDF() problem
Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
FWSavePreviewToPDF() problem
Posted: Fri Jan 13, 2012 11:56 PM
I tried the function " FWSavePreviewToPDF"
from the code below:

Code (fw): Select all Collapse
#include "fivewin.ch"
function Main()

   TPreview():bSaveAsPDF := { | oPreview, cPDF | cPDF := FWSavePreviewToPDF( oPreview ), ;
                  If( Empty( cPDF ), , ShellExecute( oPreview:oWnd:hWnd, "open", cPDF ) ) }

   XBrowse( "CUSTOMER.DBF" )

return nil


the created preview looks like this:

and:
It creates PDF file normaly but the content of the file is like this:


Strange...
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWSavePreviewToPDF() problem
Posted: Mon Jan 16, 2012 07:04 PM
Boris,

I just tested it here and worked fine:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
Re: FWSavePreviewToPDF() problem
Posted: Mon Jan 16, 2012 07:45 PM

Yes, it is strange,
I have installed on my laptop the PDF995 printer driver, maybe this is in some collision with FWH PDF managing?
As I see in a code, nothing specific has to be done, regarding the fonts.
Will try this sample on another machine

Boris

Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
Re: FWSavePreviewToPDF() problem
Posted: Mon Jan 16, 2012 11:00 PM

I tried on another, clean machine (just installed the xHB and FWH)
On that machine I have Acrobat Reader installed and that's all.
The sample behaves the same, just a square characters instead letters in created PDF.

Trying to figure out what might be wrong.

Maybe the freeimage.dll?
When I did the first time test on that other laptop, the message poped out that freeimage.dll is missing.
When I copied the dll to the proper location where the EXE resides, it works, but the PDF still scrambled.
Maybe the freeimage.dll version makes the difference?

Boris

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWSavePreviewToPDF() problem
Posted: Tue Jan 17, 2012 02:18 AM
Does it work with Harbour or free xHarbour?

Incidentally the statement
Code (fw): Select all Collapse
   TPreview():bSaveAsPDF := { | oPreview, cPDF | cPDF := FWSavePreviewToPDF( oPreview ), ;
                  If( Empty( cPDF ), , ShellExecute( oPreview:oWnd:hWnd, "open", cPDF ) ) }

can be written as:
Code (fw): Select all Collapse
   TPreview():bSaveAsPDF := { | oPreview |  FWSavePreviewToPDF( oPreview, nil, .t. ) }
Regards



G. N. Rao.

Hyderabad, India
Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
Re: FWSavePreviewToPDF() problem
Posted: Tue Jan 17, 2012 05:54 PM
Where is then the call to ShellExecute() function which will show the PDF?

In any case this doesn't solve the problem with strange characters instead letters.

(OS = Windows 7 Ultimate if this has to do something with the problem)
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: FWSavePreviewToPDF() problem
Posted: Thu May 24, 2018 02:18 PM

Hi,

I think that problem is a font issue in FwSavePreviewToPdf function.
I think FwSavePreviewToPdf() is not embbeding font. Here are you a problem.

Regards

Continue the discussion