View Issue Details

IDProjectCategoryView StatusLast Update
0032478FPCFCLpublic2017-09-27 13:10
ReporterGraeme GeldenhuysAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSFreeBSDOS Version10.3
Product Version3.1.1Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0032478: patch - fpreport PDF export page orientation bug fix
DescriptionIf page orientation was set to Landscape, the PDF exporter rendered the page from the bottom upwards. This was because the page.Matrix was set up too early in the exporter. Attached patch fixes that.
TagsNo tags attached.
Fixed in Revision37330
FPCOldBugId
FPCTarget
Attached Files
  • 0001-fpreport-PDF-Exported-fixes-page-orientation-bug-for.patch (1,314 bytes)
    From f02273d92423f33082ff65be23f1c19c50ce493b Mon Sep 17 00:00:00 2001
    From: Graeme Geldenhuys <graemeg@gmail.com>
    Date: Wed, 27 Sep 2017 11:37:43 +0100
    Subject: [PATCH] fpreport PDF Exported: fixes page orientation bug for
     poLandScape.
    
    ---
     packages/fcl-report/src/fpreportpdfexport.pp | 7 ++++---
     1 file changed, 4 insertions(+), 3 deletions(-)
    
    diff --git a/packages/fcl-report/src/fpreportpdfexport.pp b/packages/fcl-report/src/fpreportpdfexport.pp
    index c6714c10a6..007b8f7319 100644
    --- a/packages/fcl-report/src/fpreportpdfexport.pp
    +++ b/packages/fcl-report/src/fpreportpdfexport.pp
    @@ -717,13 +717,14 @@ procedure TFPReportExportPDF.DoExecute(const ARTObjects: TFPList);
         end;  { case PaperName }
         pg.UnitOfMeasure := uomMillimeters; { report measurements are always in millimeter units }
     
    +    // This must appear before configuring the pg.Matrix
    +    if rpage.Orientation = poLandscape then
    +      pg.Orientation := ppoLandscape;
    +
         // Convert from the Cartesian coordinate system to the Screen coordinate system
         pg.Matrix.SetYScalation(-1);
         pg.Matrix.SetYTranslation(pg.GetPaperHeight);
     
    -    if rpage.Orientation = poLandscape then
    -      pg.Orientation := ppoLandscape;
    -
         for b := 0 to (rpage.BandCount - 1) do
           begin
           rband := rpage.Bands[b];
    -- 
    2.13.1
    
    

Activities

Graeme Geldenhuys

2017-09-27 12:40

reporter  

0001-fpreport-PDF-Exported-fixes-page-orientation-bug-for.patch (1,314 bytes)
From f02273d92423f33082ff65be23f1c19c50ce493b Mon Sep 17 00:00:00 2001
From: Graeme Geldenhuys <graemeg@gmail.com>
Date: Wed, 27 Sep 2017 11:37:43 +0100
Subject: [PATCH] fpreport PDF Exported: fixes page orientation bug for
 poLandScape.

---
 packages/fcl-report/src/fpreportpdfexport.pp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/packages/fcl-report/src/fpreportpdfexport.pp b/packages/fcl-report/src/fpreportpdfexport.pp
index c6714c10a6..007b8f7319 100644
--- a/packages/fcl-report/src/fpreportpdfexport.pp
+++ b/packages/fcl-report/src/fpreportpdfexport.pp
@@ -717,13 +717,14 @@ procedure TFPReportExportPDF.DoExecute(const ARTObjects: TFPList);
     end;  { case PaperName }
     pg.UnitOfMeasure := uomMillimeters; { report measurements are always in millimeter units }
 
+    // This must appear before configuring the pg.Matrix
+    if rpage.Orientation = poLandscape then
+      pg.Orientation := ppoLandscape;
+
     // Convert from the Cartesian coordinate system to the Screen coordinate system
     pg.Matrix.SetYScalation(-1);
     pg.Matrix.SetYTranslation(pg.GetPaperHeight);
 
-    if rpage.Orientation = poLandscape then
-      pg.Orientation := ppoLandscape;
-
     for b := 0 to (rpage.BandCount - 1) do
       begin
       rband := rpage.Bands[b];
-- 
2.13.1

Michael Van Canneyt

2017-09-27 13:10

administrator   ~0103091

Many thanks for the patch !

Issue History

Date Modified Username Field Change
2017-09-27 12:40 Graeme Geldenhuys New Issue
2017-09-27 12:40 Graeme Geldenhuys File Added: 0001-fpreport-PDF-Exported-fixes-page-orientation-bug-for.patch
2017-09-27 13:10 Michael Van Canneyt Fixed in Revision => 37330
2017-09-27 13:10 Michael Van Canneyt Note Added: 0103091
2017-09-27 13:10 Michael Van Canneyt Status new => resolved
2017-09-27 13:10 Michael Van Canneyt Fixed in Version => 3.1.1
2017-09-27 13:10 Michael Van Canneyt Resolution open => fixed
2017-09-27 13:10 Michael Van Canneyt Assigned To => Michael Van Canneyt
2017-09-27 13:10 Michael Van Canneyt Target Version => 3.2.0