Problem with FiveWin and PDF995 on Windows 11.

byron.hopp
Posts: 388
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Problem with FiveWin and PDF995 on Windows 11.

Post by byron.hopp »

I have an application where several users utilize it every day. The IT Department just upgraded all the workstations from Windows 10 to Windows 11. Now on the reports which print to the PDF995 driver the fonts are reduced to a really small size. If they print directly to the printer the fonts look like they should. I found that if you print to the printer but preview, then in preview press the Acrobat button, that PDF is correct. I looked through the rpreview.prg and found I believe it uses FWSavePreviewToPDF(), is this code around because it seems to work better the PDF995. Or is there a way to save to PDF from the printer commands. Thanks,
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
Posts: 388
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Re: Problem with FiveWin and PDF995 on Windows 11.

Post by byron.hopp »

Update, I found prv2pdf.prg and will start playing with it. Hopefully I can eliminate PDF995.
Thanks,
Byron Hopp
Matrix Computer Services
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Problem with FiveWin and PDF995 on Windows 11.

Post by nageswaragunupudi »

It is not only easier but also desirable to depend on FWH for generation of PDFs

Very easy:
If you are using TPRINTER

Code: Select all | Expand

PRINT oPrn FILE "test.pdf"
This will create "test.pdf" instead of showing preview or print to printer.

Code: Select all | Expand

PRINT oPrn PREVIEW FILE "test.pdf:
This will create "test.pdf" and then open the pdf file for viewing.

If you are using REPORT object:

Code: Select all | Expand

REPORT oRep TO FILE "test.pdf"
// or
REPORT oRep PRVIEW TO FILE "test.pdf"
Please do not use any FWH internal functions directly.

How does FWH create PDFs?

DEFAULT:
if MS Word is installed on the PC, fwh uses MS Word to create PDF and if not
uses its own internal function FWSavePreviewToPDF().

BEST OPTION
is to use HaruPDF.

Add these lines to your program:

Code: Select all | Expand

REQUEST FWHARU

function Main()

  TPrinter():lUseHaruPDF := .T.
Now, FWH uses harupdf to generate all pdf files.

This is best option and we recommend this option.
Regards

G. N. Rao.
Hyderabad, India
byron.hopp
Posts: 388
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Re: Problem with FiveWin and PDF995 on Windows 11.

Post by byron.hopp »

Thank you Mr. Rao, modifying my code at this moment. Very complete. Byron ...
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
Posts: 388
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Re: Problem with FiveWin and PDF995 on Windows 11.

Post by byron.hopp »

I placed "Request FWHARU" at the top of my program, then I get many link errors that start with "_HB_FUN_HPDF_".
Do I need a newer version of FiveWin?
Do I need a change in my mak file?

#define FWVERSION "FWH 23.07"
#define FW_VersionNo 23070

Thanks,
Thanks,
Byron Hopp
Matrix Computer Services
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Problem with FiveWin and PDF995 on Windows 11.

Post by nageswaragunupudi »

Do I need a newer version of FiveWin?
No.
Available from FWH1909.
Do I need a change in my mak file?
Always you read fwh\samples\buildh.bat and make sure all the libs linked in that bat file are linked in your link script also.

for examples check if your link script includes

Code: Select all | Expand

echo %hdirl%\hbhpdf.lib + >> b32.bc
echo %hdirl%\libhpdf.lib + >> b32.bc
 
Regards

G. N. Rao.
Hyderabad, India
byron.hopp
Posts: 388
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Re: Problem with FiveWin and PDF995 on Windows 11.

Post by byron.hopp »

Got it, Thanks,
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
Posts: 388
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Re: Problem with FiveWin and PDF995 on Windows 11.

Post by byron.hopp »

I have tried a couple of ways, one:
Print oPrn Name cReport File cFile to cPrinter
oPrn:lUseHaruPDF := .t.

Creates a perfectly great PDF, but during the process it pops up the preview screen and immediately takes it down.
Can I eliminate the popup of the screen, it seems it would be distracting to the user.

Thanks,
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
Posts: 388
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Re: Problem with FiveWin and PDF995 on Windows 11.

Post by byron.hopp »

I have been testing with the following code:
Function TestHaru()
Local oPrn := nil
Local oFont := nil
Local cFile := Mcs_AppPath() + "TestPdf" + nAllTrim( Seconds()) + ".Pdf"
Print oPrn File cFile
Define Font oFont Name "Arial" Size 0,-14 of oPrn
oPrn:lUseHaruPDF := TRUE
Page
oPrn:InchSay( 1,1, "Hello World", oFont,,,,, )
Endpage
EndPrint
Return nil

When I run this the second time I get:
Error description: Error BASE/1005 Message not found: FWPDF:_LUSEHARUPDF
Args:
[ 1] = O FWPDF

If I quit my program and restart I can print it once again. Am I not resetting something that may cause this problem.

Thanks,
Thanks,
Byron Hopp
Matrix Computer Services
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Problem with FiveWin and PDF995 on Windows 11.

Post by nageswaragunupudi »

As we suggested above, use

Code: Select all | Expand

TPrinter():lUseHarufPDF := .t.
before executing PRINT command.
Not inside PRINT/ENDPRINT

Also please try to use later methods of Tprinter.

Please try this sample as it is:

Code: Select all | Expand

#include "fivewin.ch"

REQUEST FWHARU

function Main()

   TPrinter():lUseHaruPDF := .t.

   TestHaru()

return nil

Function TestHaru()

   local oPrn, oFont
   local cFile := "TestPdf" + cValToChar( Int( Seconds() ) ) + ".pdf"

   PRINT oPrn FILE cFile
   DEFINE FONT oFont NAME "ARIAL" SIZE 0,-30 OF oPrn
   PAGE
   @ 1, 1 PRINT TO oPrn TEXT "Hello World" SIZE 7,1 INCHES FONT oFont
   ENDPAGE
   ENDPRINT
   RELEASE FONT oFont

   ShellExecute( 0, "Open", cFile )

return nil
 
This works correctly
Regards

G. N. Rao.
Hyderabad, India
byron.hopp
Posts: 388
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Re: Problem with FiveWin and PDF995 on Windows 11.

Post by byron.hopp »

I will try your suggestion, but I do have several "Extend Class TPrinter with Data" and "with Message", can this be the problem? I use this everywhere I print, if this is the problem, can I rename the class and solve the problem?
Thanks,
Byron Hopp
Matrix Computer Services
User avatar
leandro
Posts: 1688
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia
Contact:

Re: Problem with FiveWin and PDF995 on Windows 11.

Post by leandro »

Hola buenas tardes para todos.

Al intentar agregar las librerías para usar harupdf en nuestra aplicación, nos devuelve un error al intentar compilar.

Estamos usando la librería que viene con la distribución de FW2310.

Code: Select all | Expand

Turbo Incremental Link 6.98 Copyright (c) 1997-2023 Embarcadero Technologies, Inc.
Error: 'C:\FWH2310\LIB\XHB\HARUPDF.LIB' contains invalid OMF record, type 0x21 (possibly COFF)
Link Error 
 
Image
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
byron.hopp
Posts: 388
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Re: Problem with FiveWin and PDF995 on Windows 11.

Post by byron.hopp »

"before executing PRINT command."
"Not inside PRINT/ENDPRINT"

I don't exactly understand how this work. But it does. Does this flag (lUseHaruPDF) stay true until it is set back to false, or do you need to set it everytime. Why does it not get set back to false when you initiate the "Print oPrn..." command?

Byron ...
Thanks,
Byron Hopp
Matrix Computer Services
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: Problem with FiveWin and PDF995 on Windows 11.

Post by karinha »

Leandro, intenta con estas, pls.

https://mega.nz/file/RIlSAB6J#L4qDeL8lY ... zhezinPT2w

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Problem with FiveWin and PDF995 on Windows 11.

Post by Enrico Maria Giordano »

byron.hopp wrote:"before executing PRINT command."
"Not inside PRINT/ENDPRINT"

I don't exactly understand how this work. But it does. Does this flag (lUseHaruPDF) stay true until it is set back to false, or do you need to set it everytime. Why does it not get set back to false when you initiate the "Print oPrn..." command?

Byron ...
lUseHaruPDF is a CLASSDATA that is similar to a STATIC variable. You can access it through the class itself, while a DATA can accessed only through an instance of the class.
Post Reply