PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: Issue with Blank pages
   PostPosted: 06 Oct 2015, 15:10 
Hi,

Could you please tell us is there any way to avoid the blank pages in between in PD4ML. When we generate a PDF, we were getting blank pages in between with just header and footer and no text content in this. we are using div & tables which are having margin bottom also. But is there any way in PD4ML where we can remove the pages with blank text


Regards
Sarin


  Subject: Re: Issue with Blank pages
   PostPosted: 06 Oct 2015, 15:18 
PD4ML automatically removes blank trailing pages only. In your case it would make sense to determine the problem reason.

First try to temporarily define DIV and TABLE borders to see if invisible parts of them (content padding etc) are wrapped to next pages.

DIV, TABLE { border: 1 solid tomato }


  Subject: Re: Issue with Blank pages
   PostPosted: 07 Oct 2015, 06:04 
Yes, a very very small part of the div(say, 2px) which is caused by margin bottom comes to the next page. Please let us know how we can avoid it, thanks in advance


  Subject: Re: Issue with Blank pages
   PostPosted: 07 Oct 2015, 16:13 
Try to increase htmlWidth conversion parameters in small amounts, until a page content fits a page space.


  Subject: Re: Issue with Blank pages
   PostPosted: 07 Oct 2015, 18:01 
But in our case, the contents are dynamic, so we can't do it for one page, whether any solutions to avoid this


  Subject: Re: Issue with Blank pages
   PostPosted: 07 Oct 2015, 18:22 
In your case a possible reason of an appearance of a blank page, is a page content exceeds given page height and followed by a page break directive (most probably "page-break-before: always" CSS property; possibly <pd4ml:page.break> tag).

So alternatively you may suppress/override page-break-before style (with pd4ml.addStyle() API call, for example)

But if the issue is the same with a variety of your documents (page content does not fit only few pixels), obviously the page layout has been developed for a smaller content scale. You can scale down the content by an increasing of htmlWidth parameter.

See http://pd4ml.com/cookbook/pdf_page_formatting.htm


  Subject: Re: Issue with Blank pages
   PostPosted: 08 Oct 2015, 13:10 
Thank you for your help

Could you please tell us whether it it possible to know the remaining space available in page

In page break, we are using ifSpaceBelowlessThan condition.

Likewise, whether there is any option whether we can write a div/span in JSP/FTL based on the available space in pdf


  Subject: Re: Issue with Blank pages
   PostPosted: 09 Oct 2015, 13:05 
Or whether can you please tell us whether it is possible to find out the page height , page header height, page footer height in jsp/ftl

we are using inline header/footer. So whether it is possible to find out the heights using PD4ML

thank you


  Subject: Re: Issue with Blank pages
   PostPosted: 09 Oct 2015, 14:47 
Page width and height (paper format) is given as a conversion parameter. By default it is A4.

HTML is rendered using htmlWidth parameter (an equivalent of web browser frame width).

By a conversion, htmlWidth is mapped to given paper width (minus horizontal margins).

A height of page (from HTML perspective) can be computed from the above info.

See http://pd4ml.com/cookbook/pdf_page_formatting.htm for more details.

But I would think you are trying to go a wrong way. Probably it would make more sense to enclose logical parts of document to <div style="bage-break-inside: avoid"> ... </div> sections and let PD4ML break the content to pages.


  Subject: Re: Issue with Blank pages
   PostPosted: 10 Oct 2015, 07:54 
Image

thank you for your reply

But in our case, we have a table in which we have article details. there is margin of 5 px from top & bottom. we have already given a page break inside as avoid.

In one scenario, the article length is more and it split into two pages. In that scneario, the text comes to the very last line above the footer. As we have a margin & padding, the padding only comes to the next page. As there is no content, everyone seems it as blank. If we removed the margin & span, then there is no blank page. But in our case, we can't remove the margin as the other sections/styles are depend on this. Also, we cant reduce the htmlwidth as the prototyope is already aligned. is there any solution without changing the htmlwidth. Could you please tell us the best way to solve this

thank you



[Reply]     [ 14 posts ]  Go to page 1, 2  Next

cron
Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share