PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: Duplex printing
   PostPosted: 27 Feb 2017, 23:22 
Hi All, I am new to pd4ml and have a requirement to configure duplex printing for the PDF documents that will be generated using PD4ml.

Use case is as follow:

- User can select 1 or many HTML fragments (templates) for PDF creation
- While creating PDF user can identify if duplex (double side) printing is required.
- If user selects for duplex printing, the generated PDF (combination of all the HTML files should support duplex printing e.g. after first HTML the next HTML should go to next page, so that when printing happens the second HTML fragment starts from new page)

I have browsed online help and found PD4ML defines special versions of render() methods, which accept multiple HTML documents for a conversion into a single PDF: render(URL[],...) and render(StringReader[],...). The approach will give you more predictable result (as there is no CSS style inter-mixes, could happen by document merge), but has a limitation: each source HTML document starts a new PDF page; there is no way to continue half-blank page with a new doc.

Does anyone has working Java example?


  Subject: Re: Duplex printing
   PostPosted: 10 Mar 2017, 20:20 
> each source HTML document starts a new PDF page; there is no way to continue half-blank page with a new doc.

Yes, you are right. There are some tech reasons for that in the current v3.x. If you are sure, there is no style intermixes, try to merge the HTML portions to a single HTML doc before it is passed to PD4ML. Just take into account: a closing </body> or </html> tag stops further HTML parsing, so it makes sense to remove any instances of the closing tags if they are not at the end of the resulting HTML.

Proprietary <pd4ml:page.break next="even|odd"> could help you to prepare a document for duplex printing. The page break tag inserts a blank page if needed to fulfill the "next" condition.



[Reply]     [ 2 posts ] 

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