Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #26898

    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

    #29470

    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.

    [language=css:3jovt6io]DIV, TABLE { border: 1 solid tomato }[/language:3jovt6io]

    #29465

    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

    #29466

    Try to increase htmlWidth conversion parameters in small amounts, until a page content fits a page space.

    #29467

    But in our case, the contents are dynamic, so we can’t do it for one page, whether any solutions to avoid this

    #29468

    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 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

    #29469

    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

    #29464

    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

    #29462

    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

    sections and let PD4ML break the content to pages.

    #29463

    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

    #29458

    Could you please share if you have any more thoughts on this, added the image to identify the exact issue, thank you

    #29459

    We’ll try to experimentally exclude a bottom margin (as well as a bottom padding if an element border is not defined) from element height calculations in the page break logic. In theory it should solve the issue you are faced with.

    The feature will take 2-3 days to implement/test.

    #29460

    Ok thank you, will wait for your solution

Viewing 14 posts - 1 through 14 (of 14 total)

The forum ‘General questions / FAQ’ is closed to new topics and replies.