FWSavePreviewToPDF() problem

FWSavePreviewToPDF() problem

Postby codemaker » Fri Jan 13, 2012 11:56 pm

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

Code: Select all  Expand view
#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
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: FWSavePreviewToPDF() problem

Postby Antonio Linares » Mon Jan 16, 2012 7:04 pm

Boris,

I just tested it here and worked fine:

Image
regards, saludos

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

Re: FWSavePreviewToPDF() problem

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

Re: FWSavePreviewToPDF() problem

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

Re: FWSavePreviewToPDF() problem

Postby nageswaragunupudi » Tue Jan 17, 2012 2:18 am

Does it work with Harbour or free xHarbour?

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

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

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

Re: FWSavePreviewToPDF() problem

Postby codemaker » Tue Jan 17, 2012 5: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)
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: FWSavePreviewToPDF() problem

Postby hmpaquito » Thu May 24, 2018 2: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
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 46 guests