Hello,
we found out, that exporting in a PDF creates a different size of the report compared to the result from an external PDF printer driver like Microsoft PDf or PDF24. It seems that the height is the same, but the width is a little smaller and the offset is moved to the left.
So if you would reprint the document from a saved pdf, it shows a different result than that what is printed directly to the printer. Does anonybody have similar problems or knows how to fix it?
TIA
Heiko
ReportPro3 PDF Export
ReportPro3 PDF Export
Hello Heiko,
I wondered if the PDF's from Microsoft PDF and PDF24 are exactly the same?
What I remember from earlier PDF "sessions" is that every PDF creator shows some differences, also in how it looks.
Dick
I wondered if the PDF's from Microsoft PDF and PDF24 are exactly the same?
What I remember from earlier PDF "sessions" is that every PDF creator shows some differences, also in how it looks.
Dick
ReportPro3 PDF Export
Heiko,
RP3 uses WPDF for PDF output. This code was created by Filip Fransen.
The page size is passed as an integer.
I suspect the different page size is the result of incorrect rounding.
Maybe we need to change the resolution ?
Robert
RP3 uses WPDF for PDF output. This code was created by Filip Fransen.
The page size is passed as an integer.
I suspect the different page size is the result of incorrect rounding.
Maybe we need to change the resolution ?
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
ReportPro3 PDF Export
Hello Dick,
Microsoft PDF and PDF24 both looks good. There are no visible differences in the reports i have testet. Binary they are of course not the same.
Heiko
Microsoft PDF and PDF24 both looks good. There are no visible differences in the reports i have testet. Binary they are of course not the same.
Heiko
ReportPro3 PDF Export
Robert,
that could be.
If also found this line of code:
DEFINE WPPDF_NoOffsetEMF := 32 // Activates an experimental switch which can help to remove unwanted X a,d Y offsets
I will try this setting (as an integer 1) as an initialize. And report what happens.
Heiko
that could be.
If also found this line of code:
DEFINE WPPDF_NoOffsetEMF := 32 // Activates an experimental switch which can help to remove unwanted X a,d Y offsets
I will try this setting (as an integer 1) as an initialize. And report what happens.
Heiko
ReportPro3 PDF Export
Robert,
i changed a method and got almost same results in creating a pdf compared to pdf24, but the code is really weird again.
Here are my changes. I tested them with DIN A4 and DIN A5 and different margins.
Heiko
METHOD ExportMF( sPED AS RPPageExportData, hMetaFile AS PTR, nPageNo AS LONGINT ) AS LOGIC PASCAL CLASS rpExportPDF
LOCAL nWIDTH, nHEIGHT AS FLOAT
LOCAL nTop, nLeft, nBottom as FLOAT
local nDPIDivisor:=20 as float
SELF:nLastPageNo:=nPageNo
// Calculate page : TWIPS -> 72 dpi
nWIDTH := sPED.nPaperWidth / nDPIDivisor
nHEIGHT := sPED.nPaperLength / nDPIDivisor
nLeft := sPED.nLeftMargin / nDPIDivisor
nTop := sPED.nTopMargin / nDPIDivisor
* WPDF_StartPageEx( self:liPDF, Integer(nWIDTH), Integer(nHEIGHT), iif( sPED.lLandscape, 90, 0 ) )
* Changed to no Rotation, the PDF should not display rotated!
WPDF_StartPageEx( self:liPDF, Integer(nWIDTH), Integer(nHEIGHT), iif( sPED.lLandscape, 0, 0 ) )
* WPDF_DrawMetafile( self:liPDF, hMetaFile, Integer(nLEFT), Integer(nTOP), Integer(nWIDTH-nLEFT), Integer(nHEIGHT-nTOP) )
* I really wonder why this changes the PDF in almost the same layout compared to PDF24.
* Especially I can´t explain the 1.6 factor, but somehow this works.
* nLeft+(nLeft*0.083+8.2) is also really magic, but i transformed the offset to a linar equation, and it work too.
* maybe there are bugs in the pdf-Lib.
WPDF_DrawMetafile( self:liPDF,;
hMetaFile, ;
Integer(nLeft +((nLeft)*1.6)),;
Integer(nTop+48),;
Integer(nWIDTH-((nLeft+(nLeft*0.083+8.2))/1.6)),;
Integer(nHEIGHT-20);
)
WPDF_EndPage( SELF:liPDF )
RETURN TRUE
i changed a method and got almost same results in creating a pdf compared to pdf24, but the code is really weird again.
Here are my changes. I tested them with DIN A4 and DIN A5 and different margins.
Heiko
METHOD ExportMF( sPED AS RPPageExportData, hMetaFile AS PTR, nPageNo AS LONGINT ) AS LOGIC PASCAL CLASS rpExportPDF
LOCAL nWIDTH, nHEIGHT AS FLOAT
LOCAL nTop, nLeft, nBottom as FLOAT
local nDPIDivisor:=20 as float
SELF:nLastPageNo:=nPageNo
// Calculate page : TWIPS -> 72 dpi
nWIDTH := sPED.nPaperWidth / nDPIDivisor
nHEIGHT := sPED.nPaperLength / nDPIDivisor
nLeft := sPED.nLeftMargin / nDPIDivisor
nTop := sPED.nTopMargin / nDPIDivisor
* WPDF_StartPageEx( self:liPDF, Integer(nWIDTH), Integer(nHEIGHT), iif( sPED.lLandscape, 90, 0 ) )
* Changed to no Rotation, the PDF should not display rotated!
WPDF_StartPageEx( self:liPDF, Integer(nWIDTH), Integer(nHEIGHT), iif( sPED.lLandscape, 0, 0 ) )
* WPDF_DrawMetafile( self:liPDF, hMetaFile, Integer(nLEFT), Integer(nTOP), Integer(nWIDTH-nLEFT), Integer(nHEIGHT-nTOP) )
* I really wonder why this changes the PDF in almost the same layout compared to PDF24.
* Especially I can´t explain the 1.6 factor, but somehow this works.
* nLeft+(nLeft*0.083+8.2) is also really magic, but i transformed the offset to a linar equation, and it work too.
* maybe there are bugs in the pdf-Lib.
WPDF_DrawMetafile( self:liPDF,;
hMetaFile, ;
Integer(nLeft +((nLeft)*1.6)),;
Integer(nTop+48),;
Integer(nWIDTH-((nLeft+(nLeft*0.083+8.2))/1.6)),;
Integer(nHEIGHT-20);
)
WPDF_EndPage( SELF:liPDF )
RETURN TRUE