Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 223088 - PDF Pagination
Summary: PDF Pagination
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.2.2   Edit
Hardware: PC Linux
: P3 critical with 1 vote (vote)
Target Milestone: 2.3.0 RC0   Edit
Assignee: Jerry Cheng CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 223119 223311 228647 233624 238341 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-18 10:57 EDT by Franziska Haeger CLA
Modified: 2008-06-25 04:16 EDT (History)
12 users (show)

See Also:


Attachments
Report Created with BIRT 2.2.2 (10.83 KB, application/pdf)
2008-03-18 10:57 EDT, Franziska Haeger CLA
no flags Details
Report created with BIRT 2.2.1.1 (4.92 KB, application/pdf)
2008-03-18 10:59 EDT, Franziska Haeger CLA
no flags Details
Report with PDF Pagination Problems (6.48 KB, application/octet-stream)
2008-03-19 03:20 EDT, Franziska Haeger CLA
no flags Details
PDF created with BIRT Designer 2.2.2 (2.41 KB, application/pdf)
2008-03-19 03:21 EDT, Franziska Haeger CLA
no flags Details
Report created with Webviewer "Actual Size" (2.41 KB, application/pdf)
2008-03-19 03:22 EDT, Franziska Haeger CLA
no flags Details
Patch for BIRT 2.2.2 build (59.82 KB, application/x-zip-compressed)
2008-04-17 05:24 EDT, Jerry Cheng CLA
no flags Details
Well fitted 2.2.1 report (77.24 KB, application/pdf)
2008-04-21 04:08 EDT, Simone Tregnago CLA
no flags Details
Bad fitted patched 2.2.2 report (64.34 KB, application/pdf)
2008-04-21 04:11 EDT, Simone Tregnago CLA
no flags Details
Patch 20080421 for BIRT 2.2.2 (59.83 KB, application/x-zip-compressed)
2008-04-21 05:40 EDT, Jerry Cheng CLA
no flags Details
Patch 20080422 for BIRT 2.2.2 build (59.85 KB, application/x-zip-compressed)
2008-04-21 22:09 EDT, Jerry Cheng CLA
no flags Details
Fit sample with 20080422 patch (89.31 KB, application/pdf)
2008-04-22 03:31 EDT, Simone Tregnago CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Franziska Haeger CLA 2008-03-18 10:57:34 EDT
Created attachment 92802 [details]
Report Created with BIRT 2.2.2

I just updated to BIRT 2.2.2. Now PDF Reports created with the Report Designer are shrinked to fit a single page.

For my prupose most Reports are created as multipage PDF with dynamic Grids and Tables. Pagination was conotrolled with Page Break propertie Auto, Avoid, Always.
Now only always seems to work.

I Attach PDF's created with BIRT 2.2.1.1 and BIRT 2.2.2

Franzi
Comment 1 Franziska Haeger CLA 2008-03-18 10:59:39 EDT
Created attachment 92803 [details]
Report created with BIRT 2.2.1.1
Comment 2 Wenfeng Li CLA 2008-03-18 19:07:07 EDT
Looks like a bug in the pagination handling.

Franzi,  can you attach the report design XML file?
Comment 3 Wenfeng Li CLA 2008-03-18 19:08:28 EDT
Need to decide if this bug requires a 2.2.2.1 build if there is no work around.
Comment 4 Wei Yan CLA 2008-03-19 00:48:41 EDT

*** This bug has been marked as a duplicate of bug 223119 ***
Comment 5 Wei Yan CLA 2008-03-19 02:24:39 EDT
wait for the user's design.
Comment 6 Franziska Haeger CLA 2008-03-19 03:20:55 EDT
Created attachment 92868 [details]
Report with PDF Pagination Problems

Because my original Report depends on custom data sources and a rather large libary I created a new reported that shows the same problems.
Comment 7 Franziska Haeger CLA 2008-03-19 03:21:42 EDT
Created attachment 92869 [details]
PDF created with BIRT Designer 2.2.2
Comment 8 Franziska Haeger CLA 2008-03-19 03:22:25 EDT
Created attachment 92870 [details]
Report created with Webviewer "Actual Size"
Comment 9 Franziska Haeger CLA 2008-03-19 03:25:44 EDT
Hello,

I added a newly created Report that shows the same problems. My original report depends on a ratehr large libary and a custom DataSet so I did it this way.

The Report can be created via the BIRT Deisgner and is shruink to fit the Page.
When creating the Report in Webviewer first, I can choose from different Options when exporting to PDF. But none of them show the Behaviour I want.

Either the Report is shrunk or cut at the end of the Page. With BIRT 2.2.1.1 the Report would have had Page Breaks as needed to fit the PDF Pages.

Thanks a lot

Franzi
Comment 10 Franziska Haeger CLA 2008-03-24 06:38:34 EDT
Can't this be fixed in a stable 2.2.2.1 Release?

This is really critical for my application. I can't update to Version 2.2.2 of birt if this is not fixed. And Version 2.2.1 has a bug on crosstabs that's why an update is needed?

Thanks a lot Franzi
Comment 11 Wenfeng Li CLA 2008-03-24 16:22:15 EDT
(In reply to comment #10)
> Can't this be fixed in a stable 2.2.2.1 Release?

Wei, can we attach a patch viewer to this bugzila that works for 2.2.2?

Comment 12 Jerry Cheng CLA 2008-04-09 23:33:57 EDT
*** Bug 223311 has been marked as a duplicate of this bug. ***
Comment 13 Simone Tregnago CLA 2008-04-11 05:14:32 EDT
I've found a suggested temporary patch here: 
http://www.birt-exchange.com/modules/vbulletin/showthread.php?p=31072
If this work, could someone attach a precompiled patched viewservlets.jar?
Comment 14 Jerry Cheng CLA 2008-04-14 22:54:20 EDT
*** Bug 223119 has been marked as a duplicate of this bug. ***
Comment 15 Jerry Cheng CLA 2008-04-15 02:56:46 EDT
Add __pageoverflow URL parameter to support the following PDF overflow modes:
1) __pageoverflow = 0 -------- Auto
2) __pageoverflow = 1 -------- Actual size
3) __pageoverflow = 2 --------  Fit to page
Comment 16 Wenfeng Li CLA 2008-04-15 14:02:04 EDT
Jerry,

1) __pageoverflow = 0 -------- Auto
2) __pageoverflow = 1 -------- Actual size
3) __pageoverflow = 2 --------  Fit to page

What is the behavior of Auto setting?  Is it the same as Actual Size or is it the setting the will expand the PDF page to include the overflow contents?

What is the default value for the setting?


Please also attach a viewer patch for 2.2.2 to this bugzilla?
Comment 17 Wenbin He CLA 2008-04-15 17:28:29 EDT
In BIRT 2.2.1, there are two output modes are supported:
- Actual size. The report content will be outputted in actual size. If the report content size is larger than the specified master page size, the report content will truncated. 
- Fit to page.  The report content will be scaling to fit to the master page size.  

In both modes, the report export will always honor the HTML pagination, so the number of the pages in PDF/PS will be the same as in HTML.  The two issue mentioned (content truncation and too small to read in PDF) could be addressed by increasing the master page size.  It’s the report developers responsibility to make sure they have set the proper master page size, and the right pagination, so the output in PDF will look good.  

To address the issue raised in the bug, we plan to add a third option in report export. With this option, the PDF page size will be automatically expanded when the page content exceeds the specified master page size.  The report content will be output with actual size. Still no re-pagination is required for PDF export in this mode, and the number of pages in PDF will be the same as in HTML.
Comment 18 Wenfeng Li CLA 2008-04-15 17:38:58 EDT
Bugzilla feedbacks from many users suggest that there is a need of keeping the page size as master page and do not clip the contents.  In short, we shall provide following following options:

1. scale the content to fit the page.
2. expand the PDF page to fit the content (just like HTML page)
3. keep the PDF page size as the master page size, but overflow the content to next PDF page.


The first two cases the page count in PDF = page count in HTML.

In the 3rd case, there will be more PDF page than HTML pages, but user seems do not think this is an issue.

I suggest we use 
1. auto = keep the PDF page size as the master page size, but overflow the content to next PDF page.  and have this as default.
2. Actual size = expand the PDF page to fit the content (just like HTML page)
3. fit to page = scale the content to fit the page.

In theory we can also provide a 4th option of
4. Keep the PDF page size as the master page size, clip the overflow contents.
Not sure there is usage of such an option, however.  Maybe wait until there is a need for it?


Comment 19 Wenbin He CLA 2008-04-15 18:17:02 EDT
ok. We will add the following options in the BIRT viwer export page:

1. auto = keep the PDF page size as the master page size, but overflow the
content to next PDF page.  and have this as default.
2. Actual size = expand the PDF page to fit the content (just like HTML page).  
3. fit to page = scale the content to fit the page.

The "actual size" option is essentially the same as the "auto" option as I suggested in comment #17.  Currently (BIRT 2.2.1) the "actual size" option will output the content in actual size, and truncate the content if the content exceeds the page size. 

When expanding the PDF page size, I suggest not to honor the master page width/height ratio otherwise, there will be a lot of white space because the report content is unlikely to have the same width/height ratio. 
Comment 20 Jerry Cheng CLA 2008-04-15 23:19:48 EDT
(In reply to comment #16)
> Jerry,
> 1) __pageoverflow = 0 -------- Auto
> 2) __pageoverflow = 1 -------- Actual size
> 3) __pageoverflow = 2 --------  Fit to page
> What is the behavior of Auto setting?  Is it the same as Actual Size or is it
> the setting the will expand the PDF page to include the overflow contents?
> What is the default value for the setting?
> Please also attach a viewer patch for 2.2.2 to this bugzilla?

For auto setting, it will keep HTML pagination and set PAGE_OVERFLOW to OUTPUT_TO_MULTIPLE_PAGES which will keep the actual size of the content and the page(If the content exceeds the page size, divide it into multiple pages).

The default setting is auto.

I will make a patch for 2.2.2 later.

Comment 21 Jerry Cheng CLA 2008-04-17 05:24:00 EDT
Created attachment 96405 [details]
Patch for BIRT 2.2.2 build

For BIRT 2.2.2 build, we provide this patch to roll back behavior to 2.2.1.

Please update the same files in patch zip file.
Comment 22 Jerry Cheng CLA 2008-04-17 05:25:04 EDT
Fixed it.
Comment 23 Simone Tregnago CLA 2008-04-17 09:21:23 EDT
It's possible to have a bin patch that don't require to download and recompile the Viewer?
Comment 24 andreas CLA 2008-04-18 06:07:25 EDT
(In reply to comment #21)
> Created an attachment (id=96405) [details]
> Patch for BIRT 2.2.2 build
> 
> For BIRT 2.2.2 build, we provide this patch to roll back behavior to 2.2.1.
> 
> Please update the same files in patch zip file.
> 

Hi, i'm a little bit confused about functionality.
I adopted the delivered patch in my 2.2.2 version.

But there is not the same behaviour like in Version 2.2.1.

I try to explain:
I have the same situation like Franzi described in comment 9.

Before applying the patch the situation was as follows:
with the URL Parameter __format=pdf the Output was fitted to one page (not readible).
When exporting to PDF via Web Viewer with option actual Size the content was truncated.

After applying the patch i have the following situation:
with the URL Parameter  __format=pdf the content is divided over multiple pages in PDF. That's OK.
But when i export to PDF via Web Viewer then the content is still truncated after the first PDF page. (this was not the case in 2.2.1)

Have i missed something?

Andreas
Comment 25 Simone Tregnago CLA 2008-04-18 06:17:57 EDT
sorry, my mistake,
I had don't understood how to apply the patch (into viewservlets.jar)
Comment 26 Simone Tregnago CLA 2008-04-18 11:03:24 EDT
Applying the patch PDF works better but it seems that the URL __pageoverflow parameter don't work.
changing it from 0 to 1 or 2 doesn't change the PDF pagination.
Comment 27 Jerry Cheng CLA 2008-04-20 22:55:44 EDT
Please update the JSPs in patch.
And clear pre-compile JSPs.

(In reply to comment #24)
> (In reply to comment #21)
> > Created an attachment (id=96405) [details] [details]
> > Patch for BIRT 2.2.2 build
> > 
> > For BIRT 2.2.2 build, we provide this patch to roll back behavior to 2.2.1.
> > 
> > Please update the same files in patch zip file.
> > 
> Hi, i'm a little bit confused about functionality.
> I adopted the delivered patch in my 2.2.2 version.
> But there is not the same behaviour like in Version 2.2.1.
> I try to explain:
> I have the same situation like Franzi described in comment 9.
> Before applying the patch the situation was as follows:
> with the URL Parameter __format=pdf the Output was fitted to one page (not
> readible).
> When exporting to PDF via Web Viewer with option actual Size the content was
> truncated.
> After applying the patch i have the following situation:
> with the URL Parameter  __format=pdf the content is divided over multiple pages
> in PDF. That's OK.
> But when i export to PDF via Web Viewer then the content is still truncated
> after the first PDF page. (this was not the case in 2.2.1)
> Have i missed something?
> Andreas

Comment 28 Jerry Cheng CLA 2008-04-20 22:56:35 EDT
Sorry, in 2.2.2, we don't support "__pageoverflow" URL paraemter.
It is supported in 2.3.0 build.

(In reply to comment #26)
> Applying the patch PDF works better but it seems that the URL __pageoverflow
> parameter don't work.
> changing it from 0 to 1 or 2 doesn't change the PDF pagination.

Comment 29 Jerry Cheng CLA 2008-04-20 23:04:24 EDT
Sorry, Please update the JS files in patch.
And clear browser cache.

(In reply to comment #27)
> Please update the JSPs in patch.
> And clear pre-compile JSPs.
> (In reply to comment #24)
> > (In reply to comment #21)
> > > Created an attachment (id=96405) [details] [details] [details]
> > > Patch for BIRT 2.2.2 build
> > > 
> > > For BIRT 2.2.2 build, we provide this patch to roll back behavior to 2.2.1.
> > > 
> > > Please update the same files in patch zip file.
> > > 
> > Hi, i'm a little bit confused about functionality.
> > I adopted the delivered patch in my 2.2.2 version.
> > But there is not the same behaviour like in Version 2.2.1.
> > I try to explain:
> > I have the same situation like Franzi described in comment 9.
> > Before applying the patch the situation was as follows:
> > with the URL Parameter __format=pdf the Output was fitted to one page (not
> > readible).
> > When exporting to PDF via Web Viewer with option actual Size the content was
> > truncated.
> > After applying the patch i have the following situation:
> > with the URL Parameter  __format=pdf the content is divided over multiple pages
> > in PDF. That's OK.
> > But when i export to PDF via Web Viewer then the content is still truncated
> > after the first PDF page. (this was not the case in 2.2.1)
> > Have i missed something?
> > Andreas

Comment 30 andreas CLA 2008-04-21 03:06:01 EDT
(In reply to comment #29)
> Sorry, Please update the JS files in patch.
> And clear browser cache.

Hi,
i have adopted the JS-Files and cleared my Cache.
That's not the reason.

Any other hints?

Andreas
Comment 31 Simone Tregnago CLA 2008-04-21 04:06:49 EDT
I don't know if it's caused by the missing __pageoverlow parameter but the report with the patched 2.2.2 doesn't well autofit in all the pages.
I've attached the same report output produced by the 2.2.1 and the 2.2.2-patched.
I've already cleared the browser cache.
As you can see in 2.2.2-patched sometimes page break occours before the end of the page.
Comment 32 Simone Tregnago CLA 2008-04-21 04:08:57 EDT
Created attachment 96782 [details]
Well fitted 2.2.1 report

This report shows how 2.2.1 could auto-fit tables with a good page break
Comment 33 Simone Tregnago CLA 2008-04-21 04:11:55 EDT
Created attachment 96786 [details]
Bad fitted patched 2.2.2 report

Here you can see how the patched 2.2.2 sometimes doesn't fill pages
Comment 34 Jerry Cheng CLA 2008-04-21 05:39:02 EDT
(In reply to comment #30)
> (In reply to comment #29)
> > Sorry, Please update the JS files in patch.
> > And clear browser cache.
> Hi,
> i have adopted the JS-Files and cleared my Cache.
> That's not the reason.
> Any other hints?
> Andreas

Hi Andreas,

  You are right. There is an issue when render document as PDF.
  Please check the new patch for 2.2.2 build.

Thanks.
Comment 35 Jerry Cheng CLA 2008-04-21 05:40:20 EDT
Created attachment 96814 [details]
Patch 20080421 for BIRT 2.2.2
Comment 36 andreas CLA 2008-04-21 07:04:23 EDT
(In reply to comment #35)
> Created an attachment (id=96814) [details]
> Patch 20080421 for BIRT 2.2.2
> 

Hi Jerry,
the only difference between the two patches is the ReportEngineService.class file.
Because i recompiled using the source files i see no difference between the patches.

Am i wrong?

Andreas
Comment 37 Jerry Cheng CLA 2008-04-21 22:09:17 EDT
Created attachment 96951 [details]
Patch 20080422 for BIRT 2.2.2 build

Please try this one. I also included the latest source code.
Comment 38 Simone Tregnago CLA 2008-04-22 03:31:00 EDT
Created attachment 96981 [details]
Fit sample with 20080422 patch

Tried with the latest 20080422 patch but it doesn't change anything. I attach another sample report where you can see how page break change in every page. Hoping it could help.
Comment 39 Jerry Cheng CLA 2008-04-22 04:08:09 EDT
(In reply to comment #38)
> Created an attachment (id=96981) [details]
> Fit sample with 20080422 patch
> Tried with the latest 20080422 patch but it doesn't change anything. I attach
> another sample report where you can see how page break change in every page.
> Hoping it could help.

Hi Simone,

  This patch doesn't focus on your issue.
  I guess your issue is due to engine PDF output mechanisms changes. For this case, we will treat HTML pagination as false and engine will calculate the page break. So maybe PDF output is different between these two milestones.
  Engine doesn't ensure this output consistent in every milestone. But from 2.3.0 RC0, engine has introduced "PAGE_OVERFLOW" option and it will focus on this case. But in 2.2.2, we don't support it.

  Thanks.
Comment 40 Jerry Cheng CLA 2008-04-24 23:06:43 EDT
*** Bug 228647 has been marked as a duplicate of this bug. ***
Comment 41 andreas CLA 2008-04-25 05:28:34 EDT
(In reply to comment #37)
> Created an attachment (id=96951) [details]
> Patch 20080422 for BIRT 2.2.2 build
> 
> Please try this one. I also included the latest source code.
> 

Hi Jerry,
Many thanks, that does the trick!

Andreas
Comment 42 Wei Yan CLA 2008-06-01 23:32:45 EDT
*** Bug 233624 has been marked as a duplicate of this bug. ***
Comment 43 Jerry Cheng CLA 2008-06-25 04:16:34 EDT
*** Bug 238341 has been marked as a duplicate of this bug. ***