PDF render options [message #815195] |
Wed, 07 March 2012 10:41 |
sam va Messages: 121 Registered: July 2011 |
Senior Member |
|
|
Hi we are using the following code to generate pdf
PDFRenderOption options = new PDFRenderOption();
options.setOption(PDFRenderOption.PAGE_OVERFLOW, PDFRenderOption.FIT_TO_PAGE_SIZE);
options.setOption(IPDFRenderOption.FIT_TO_PAGE, true);
options.setOption(IPDFRenderOption.PAGEBREAK_PAGINATION_ONLY, Boolean.FALSE);
options.setOption(IPDFRenderOption.PDF_PAGE_LIMIT, new Integer(pageNumber));
options.setOutputFileName(docName);
options.setFontDirectory(fontDirectory);
options.setEmbededFont(true);
task1 = birtReportEngine.createRenderTask(document);
task1.setRenderOption(options);
task1.render();
ideally we would like the pages in PDF should not break. even after setting the PAGE_OVERFLOW property, the pages are breaking where it is unexpected.
Any help is appreciated
Thanks
[Updated on: Wed, 07 March 2012 12:51] Report message to a moderator
|
|
|
Re: PDF render options [message #815633 is a reply to message #815195] |
Wed, 07 March 2012 22:07 |
|
Try:
PDFRenderOption options = new PDFRenderOption();
options.setOutputFileName("output/resample/testpdf.pdf");
options.setSupportedImageFormats("PNG;GIF;JPG;BMP;SWF;SVG");
//options.setOption(PDFRenderOption.PAGE_OVERFLOW,
IPDFRenderOption.ENLARGE_PAGE_SIZE);
options.setOption(PDFRenderOption.PAGE_OVERFLOW,
IPDFRenderOption.FIT_TO_PAGE_SIZE);
options.setOption( IRenderOption.HTML_PAGINATION,
Boolean.FALSE );
options.setOutputFormat("pdf");
Set the overflow to enlarge page or fit to page as needed.
Jason
On 3/7/2012 5:42 AM, sam va wrote:
> Hi we are using the following code to generate pdf
>
>
> PDFRenderOption options = new PDFRenderOption();
> options.setOption(PDFRenderOption.PAGE_OVERFLOW,
> PDFRenderOption.FIT_TO_PAGE_SIZE);
> options.setOption(IPDFRenderOption.FIT_TO_PAGE, true);
> options.setOption(IPDFRenderOption.PAGEBREAK_PAGINATION_ONLY,
> Boolean.FALSE);
> options.setOption(IPDFRenderOption.PDF_PAGE_LIMIT, new
> Integer(pageNumber));
> options.setOutputFileName(docName);
> options.setFontDirectory(fontDirectory);
> options.setEmbededFont(true);
> task1 = birtReportEngine.createRenderTask(document);
> task1.setRenderOption(options);
> task1.render();
>
>
> ideally we would like the pages in PDF should not break. even after
> setting the PAGE_OVERFLOW property, the pages are breaking.
>
> Any help is appreciated
>
> Thanks
|
|
|
|
|
Re: PDF render options [message #816501 is a reply to message #815848] |
Thu, 08 March 2012 23:27 |
|
The options I posted should do this. Make sure you set this one:
options.setOption( IRenderOption.HTML_PAGINATION,
Boolean.FALSE );
What version are you using?
Jason
On 3/8/2012 12:22 AM, Ganapathy Murugan Rajamanickavasagam wrote:
> Jason,
> To add more details...
> Lets say the Masterpage height is 10 inches and the detail row contents
> has fields that span multiple lines. When paginated HTML is rendered the
> page height expands and fits in all the content.
>
> But when we export to PDF the same HTML page splits into 2 pages in PDF
> as the content cannot fit in the PDF page.
>
> We need the PDF page to not split. Thanks for your help
>
> Ganapathy
|
|
|
Re: PDF render options [message #816502 is a reply to message #816288] |
Thu, 08 March 2012 23:29 |
|
What version are you using? Did you use all the options shown?
If your content is a table does changing the page break interval have
any effect.
Jason
On 3/8/2012 11:52 AM, sam va wrote:
> Jason
>
> Even after the above code, we still have unwanted page breaks in PDF
>
> Thanks
|
|
|
|
Re: PDF render options [message #817224 is a reply to message #816692] |
Fri, 09 March 2012 20:15 |
|
Is the report set to fixed layout? Can you an example report using
sample db?
Jason
On 3/9/2012 1:34 AM, sam va wrote:
> we are using 3.7
> Also we set the page break interval to 0. Still we see these issues in
> multiple reports. lets say HTML accomodates 20 records in one page,
> sometimes in PDF 19 records will come in one page and 1 record will come
> in the second page. And the rest of the second page is empty. data will
> start again in third page.
>
> thanks
|
|
|
|
|
|
Re: PDF render options [message #821196 is a reply to message #821149] |
Thu, 15 March 2012 03:19 |
sam va Messages: 121 Registered: July 2011 |
Senior Member |
|
|
Jason
Here is the sample pdf and report. Pl notice that the contents in page 5 should actually be in page 4. this content has overflowed to the next page.
You will notice this ONLY if you do this
View Report in HTML -> Export to PDF
Also notice that, even if you specify "Fit to whole page" this issue is reproducible
If you directly View the report in PDF, this issue doesnt come up
Thanks
[Updated on: Thu, 15 March 2012 03:22] Report message to a moderator
|
|
|
|
Re: PDF render options [message #821665 is a reply to message #821196] |
Thu, 15 March 2012 17:04 |
|
Sam,
Run the attached report and see if you get the issue.
I just took the report you posted and set the page break interval to 0
for the table. Without that setting this produces a 117 pg report.
With it set to 0, it produces a 114 pg report.
Jason
On 3/14/2012 11:19 PM, sam va wrote:
> Jason
>
> Here is the sample pdf and report. Pl notice that the contents in page 5 should actually be in page 4. this content has overflowed to the next page.
>
> Thanks
>
-
Attachment: pdftest.zip
(Size: 3.26KB, Downloaded 347 times)
|
|
|
Re: PDF render options [message #821666 is a reply to message #821665] |
Thu, 15 March 2012 17:05 |
|
I really need to read all of a thread before responding :>
Jason
On 3/15/2012 1:04 PM, Jason Weathersby wrote:
> Sam,
>
> Run the attached report and see if you get the issue.
> I just took the report you posted and set the page break interval to 0
> for the table. Without that setting this produces a 117 pg report. With
> it set to 0, it produces a 114 pg report.
>
> Jason
>
> On 3/14/2012 11:19 PM, sam va wrote:
>> Jason
>>
>> Here is the sample pdf and report. Pl notice that the contents in page
>> 5 should actually be in page 4. this content has overflowed to the
>> next page.
>>
>> Thanks
>>
>
|
|
|
Re: PDF render options [message #831819 is a reply to message #821666] |
Thu, 29 March 2012 11:47 |
sam va Messages: 121 Registered: July 2011 |
Senior Member |
|
|
I worked backward from our report... and was able to successfully reproduce the issue.
Run the report from web viewer. Then export PDF out of the viewer.
Choosing any export options will be the same output. Check the 2nd page. This page has data which has overflown from 1st page.
Jason, its very critical for us. Any help in fixing the issue will be helpful for us.
FYI: One fix would be fixing the detail row height. But we have lot of dynamic text controls with varying data. Fixing the height will truncate the data.
Thanks
[Updated on: Thu, 29 March 2012 11:51] Report message to a moderator
|
|
|
|
Re: PDF render options [message #832380 is a reply to message #831876] |
Fri, 30 March 2012 04:13 |
|
Where is the variable rowcount set? I thought you were going to
re-upload a report with the issue so I could debug?
Jason
On 3/29/2012 9:22 AM, sam va wrote:
> I believe the problem is with the following piece of code.
>
> <cell id="3017">
> <method name="onRender"><![CDATA[var myformat =
> reportContext.getOutputFormat();
>
> if( rowcount > 1 ){
> this.getStyle().borderTopWidth = rowBorderWidth;
> this.getStyle().borderTopStyle = rowBorderStyle;
> this.getStyle().borderTopColor = rowBorderColor;
> }]]></method>
>
>
> if we remove all the instances of the above code, this works fine.
>
> Thanks
|
|
|
Re: PDF render options [message #832910 is a reply to message #832380] |
Fri, 30 March 2012 18:49 |
sam va Messages: 121 Registered: July 2011 |
Senior Member |
|
|
I uploaded the design (Thu, 29 March 2012 07:47)... with that design we are able to reproduce..
but why wouldnt the followin code work
options.setOption(PDFRenderOption.PAGE_OVERFLOW,
IPDFRenderOption.FIT_TO_PAGE_SIZE);
options.setOption( IRenderOption.HTML_PAGINATION,
Boolean.FALSE );
Could you pl tell me why its not fitting into one page
[Updated on: Fri, 30 March 2012 18:53] Report message to a moderator
|
|
|
Re: PDF render options [message #832944 is a reply to message #832910] |
Fri, 30 March 2012 19:25 |
|
I believe the page break interval will override that setting.
Jason
On 3/30/2012 2:49 PM, sam va wrote:
> I uploaded the design... with that desiggn we are able to reproduce..
>
> but why wouldnt the followin code work
>
> options.setOption(PDFRenderOption.PAGE_OVERFLOW,
> IPDFRenderOption.FIT_TO_PAGE_SIZE);
> options.setOption( IRenderOption.HTML_PAGINATION,
> Boolean.FALSE );
>
> ITs not fitting into one page
|
|
|
Re: PDF render options [message #1767439 is a reply to message #832944] |
Thu, 06 July 2017 06:11 |
Priya M Messages: 2 Registered: June 2017 |
Junior Member |
|
|
Hi. I am working on a BIRT report with one of the cell is a dynamic text element. I have set the 'Overflow property - Auto' in Advanced tab of the cell properties, since the last few parts in the cell are invisible in the report.
Scroll bar appears for the element, if the data inside the text element is too long and the entire content is visible using the scroll. This works fine in BIRT Report viewer. However I am facing problem in exporting the report into PDF format wherein the last few parts are truncated.
I am using the eclipse BIRT version 4.5.0
Kindly help me in this issue
Thanks
[Updated on: Thu, 06 July 2017 06:12] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.06637 seconds