FWSavePreviewToPDF() problem

Post Reply
User avatar
codemaker
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

FWSavePreviewToPDF() problem

Post by codemaker »

I tried the function " FWSavePreviewToPDF"
from the code below:

Code: Select all | Expand

#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:
Image
and:
It creates PDF file normaly but the content of the file is like this:
Image

Strange...
User avatar
Antonio Linares
Site Admin
Posts: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: FWSavePreviewToPDF() problem

Post by Antonio Linares »

Boris,

I just tested it here and worked fine:

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
codemaker
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: FWSavePreviewToPDF() problem

Post by codemaker »

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
User avatar
codemaker
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: FWSavePreviewToPDF() problem

Post by codemaker »

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
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: FWSavePreviewToPDF() problem

Post by nageswaragunupudi »

Does it work with Harbour or free xHarbour?

Incidentally the statement

Code: Select all | Expand

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

can be written as:

Code: Select all | Expand

  TPreview():bSaveAsPDF := { | oPreview |  FWSavePreviewToPDF( oPreview, nil, .t. ) }
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
codemaker
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: FWSavePreviewToPDF() problem

Post by codemaker »

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)
hmpaquito
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: FWSavePreviewToPDF() problem

Post by hmpaquito »

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
Post Reply