Page 2 of 2
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Wed Feb 14, 2024 9:27 pm
by leandro
Amigo Joao, gracias por responder
Con las libs que me enviaste, nos sale un nuevo error
Code: Select all | Expand
Turbo Incremental Link 6.98 Copyright (c) 1997-2023 Embarcadero Technologies, Inc.
Error: Unresolved external '_HB_FUN_HPDF_USEUTFENCODINGS' referenced from C:\FWH2310\LIB\FIVEHX.LIB|FWPDF
Error: Unable to perform link
Link Error
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Thu Feb 15, 2024 1:06 am
by nageswaragunupudi
We are using the library that comes with the FW2310 distribution.
The libraries in fwh\lib\xhb are only meant for xhb.com users but not xharbour users.
For xharbour link the libraries from "\xharbour\lib\"
Always the best way to know what libraries are to be linked, please open fwh\samples\buildx.bat and see the path and libraries included.
This is extract from buildx.bat
Code: Select all | Expand
echo %hdirl%\hbhpdf.lib + >> b32.bc
echo %hdirl%\libharu.lib + >> b32.bc
and %hdirl% means xharbour\lib
I posted a sample above.
Please save that sample as it is to \fwh2310\samples folder and build it with buildx.bat and let us know if it is working for you.
We will take it forward from there.
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Thu Feb 15, 2024 1:54 am
by nageswaragunupudi
byron.hopp wrote: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?
Yes.
Works correctly if you are using unmodified printer.prg
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Thu Feb 15, 2024 3:20 pm
by byron.hopp
So does lUseHaruPDF stay set to true until you set it back to false?
If I access the lUseHaruPDF through the Class does it still act as static?
Also even through using Haru may be the best, I would have to rewrite many of my print routines which uses Inch2Pix, and Pix2Inch.
And possibly many other methods.
Which I will rewrite to using Unit2Pix, and Pix2Unit, or may not need at all because of the cUnits parameter on most print methods.
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Thu Feb 15, 2024 3:24 pm
by Enrico Maria Giordano
byron.hopp wrote:So does lUseHaruPDF stay set to true until you set it back to false?
If I access the lUseHaruPDF through the Class does it still act as static?
Yes.
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Thu Feb 15, 2024 3:32 pm
by nageswaragunupudi
byron.hopp wrote:So does lUseHaruPDF stay set to true until you set it back to false?
If I access the lUseHaruPDF through the Class does it still act as static?
Also even through using Haru may be the best, I would have to rewrite many of my print routines which uses Inch2Pix, and Pix2Inch.
And possibly many other methods.
Which I will rewrite to using Unit2Pix, and Pix2Unit, or may not need at all because of the cUnits parameter on most print methods.
Using cUnits parameter is the best option. That keeps compatibility between Pdf class and Printer class.
For now you can start creating PDF files with FWH without HaruPdf.
This command
directly creates PDF file even without HaruPdf.
You don't need it now but just for information:
will save the output as an image file too.
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Thu Feb 15, 2024 3:35 pm
by byron.hopp
Sweet, Thank you,
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Thu Feb 15, 2024 3:42 pm
by nageswaragunupudi
Also we advise using the PRINT commands from print.ch rather than directly using the methods.
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Thu Feb 15, 2024 3:56 pm
by leandro
nageswaragunupudi wrote:We are using the library that comes with the FW2310 distribution.
The libraries in fwh\lib\xhb are only meant for xhb.com users but not xharbour users.
For xharbour link the libraries from "\xharbour\lib\"
Always the best way to know what libraries are to be linked, please open fwh\samples\buildx.bat and see the path and libraries included.
This is extract from buildx.bat
Code: Select all | Expand
echo %hdirl%\hbhpdf.lib + >> b32.bc
echo %hdirl%\libharu.lib + >> b32.bc
and %hdirl% means xharbour\lib
I posted a sample above.
Please save that sample as it is to \fwh2310\samples folder and build it with buildx.bat and let us know if it is working for you.
We will take it forward from there.
Gracias Mr. Rao con las librerías que nos indicaste se pudo compilar correctamente.
Pero, el proceso de generación de los pdf con EasyReport no funciona. Modificamos este ejemplo con las opciones que nos indicaste, pero genera un pdf en blanco.
El código del ejemplo de EasyReport modificado
erep01.prg
Code: Select all | Expand
#include "FiveWin.ch"
#include "easyrep.ch"
// ----------------------------------------------------------------------------//
REQUEST FWHARU
FUNCTION Main()
LOCAL aStates, aCust, aRow, nAt, nStateCol
LOCAL oDlg, oBrwStates, oBrwCust, oBtn
TPrinter():lUseHaruPDF := .t.
USE STATES
aStates := FW_DbfToArray()
USE CUSTOMER
nStateCol := FieldPos( "state" )
aCust := FW_DbfToArray()
CLOSE CUSTOMER
AEval( aStates, {| a| AAdd( a, Array( 0 ) ) } )
FOR EACH aRow in aCust
nAt := AScan( aStates, {| a| a[ 1 ] == aRow[ nStateCol ] } )
IF nAt > 0
AAdd( aStates[ nAt, 3 ], aRow )
ENDIF
NEXT
DEFINE DIALOG oDlg ;
TITLE "EasyReport with Array" ;
SIZE 1000, 600 ;
PIXEL ;
TRUEPIXEL
@ 0, 0 ;
BTNBMP oBtn ;
PROMPT "EasyReport" ;
OF oDlg ;
ACTION DruckListe( aStates ) ;
COLOR CLR_WHITE, CLR_MAGENTA ;
FLAT SIZE 100, 32
@ 40, 20 XBROWSE oBrwStates SIZE 270, -20 PIXEL OF oDlg ;
DATASOURCE aStates ;
COLUMNS 1, 2 HEADERS "CODE", "NAME" ;
CELL LINES NOBORDER
WITH OBJECT oBrwStates
:bChange := {|| oBrwCust:aArrayData := oBrwStates:aRow[ 3 ], ;
oBrwCust:GoTop(), oBrwCust:Refresh() }
:CreateFromCode()
END
@ 40, 290 ;
XBROWSE oBrwCust ;
OF oDlg ;
PIXEL ;
SIZE - 20, -20 ;
DATASOURCE aStates[ 1, 3 ] ;
COLUMNS 2, 3, 5, 6 ;
HEADERS "FIRST", "LAST", "CITY", "STATE" ;
CELL ;
LINES ;
NOBORDER
WITH OBJECT oBrwCust
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
// -----------------------
FUNCTION DruckListe( aStates )
LOCAL oVRD
LOCAL lPreview := .T.
LOCAL cDruckerName := ""
LOCAL cTemp := ""
LOCAL nNr := 1
LOCAL nSeite := 0
LOCAL nIdx := 0
LOCAL I := 0
LOCAL aTemp := {}
local oPrn
// ----------------------------------------------------------
TPreview():lListViewHide := .f.
EASYREPORT oVRD NAME "erep01\states.vrd" PREVIEW .t. //FILE "erep01.pdf"
PRINTAREA 1 OF oVRD ;
ITEMIDS { 101, 102 } ;
ITEMVALUES { "Report with array", DToC( Date() ) }
PRINTAREA 2 OF oVRD;
ITEMIDS { 100 } ;
ITEMVALUES { "Anyone have a sample how i can relationate 2 arrays (masterdata/detail) and pass to fastreport?" }
PRINTAREA 7 OF oVRD
FOR nIdx := 1 TO Len( aStates )
PRINTAREA 3 OF oVRD ;
ITEMIDS { 100, 101, 102 } ;
ITEMVALUES { "c:\fwh\samples\xVrd\kreis.jpg", aStates[ nIdx, 1 ], ;
aStates[ nIdx, 2 ] }
aTemp := aStates[ nIdx, 3 ]
FOR I := 1 TO Len( aTemp )
PRINTAREA 4 OF oVRD ;
ITEMIDS { 102, 103, 104, 105 } ;
ITEMVALUES { aTemp[ I, 2 ], aTemp[ I, 3 ], aTemp[ I, 4 ], aTemp[ I, 5 ] }
IF oVRD:nNextRow > oVRD:nPageBreak
nSeite := nSeite + 1
PRINTAREA 5 OF oVRD ;
ITEMIDS { 100 } ;
ITEMVALUES { AllTrim( Str( nSeite ) ) }
PAGEBREAK oVRD
PRINTAREA 6 OF oVRD
PRINTAREA 2 OF oVRD
PRINTAREA 7 OF oVRD ;
ITEMIDS { 120 } ;
ITEMVALUES { DToC( Date() ) }
ENDIF
NEXT
NEXT
oVRD:End()
RETURN NIL
// ----------------------------------------------------------------------------//
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Thu Feb 15, 2024 5:35 pm
by nageswaragunupudi
Did you first try to build the sample I posted above with buildx.bat in the samples folder?
If you let me know if it is working for you or not, then I can advise you further
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Thu Feb 15, 2024 6:16 pm
by byron.hopp
I use BuildH.bat to compare. Let me do it again using BuildX.bat. No matter, your sample worked great when I tested even though I setup using the BuildH.bat for Libs. I did notice that my exe on me production program is much larger.
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Thu Feb 15, 2024 6:25 pm
by leandro
nageswaragunupudi wrote:Did you first try to build the sample I posted above with buildx.bat in the samples folder?
If you let me know if it is working for you or not, then I can advise you further
El ejemplo que publicaste al inicio funciona correctamente.
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Thu Feb 15, 2024 7:37 pm
by byron.hopp
Yes, your sample works great, however my code utilizes many methods of the TPrinter class, and not all of them are duplicated in the FWPdf class.
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Thu Feb 15, 2024 9:59 pm
by byron.hopp
I am trying to create a new mak file based on the Buildx.bat, cannot find libharu.lib, anyone know where I can find this?
It is not in my Harbour Lib directory. Does this mean I might not have the right version of Harbour?
Thanks,
Re: Problem with FiveWin and PDF995 on Windows 11.
Posted: Thu Feb 15, 2024 10:11 pm
by Enrico Maria Giordano
The correct names of the haru libraries are hbhpdf.lib and libhpdf.lib. Please look inside buildh.bat.