 |
 |
 |
 |
 |
PDF Generating Tool Support Forum |
 |
|
Subject: Dynamic change of PDF page orientation PD4ML
Posted: 22 Oct 2009, 16:56 |
|
|
The attached documents illustrate how to use htmlWidth and pageFormat attributes of <pd4ml:page.break>
|
|
| |
 |
Subject: How to set different margins in the same PDF document? |
|
|
Hi, I am evaluating PD4ML. We need to print a document with two different margins on either side of the sheet. That is, on the first page we have a broader margin on the left side and on the next side we have a shorter margin on the left side. Can we do this in PD4ML? If so, how? Alex Philip
|
|
| |
 |
Subject: Re: Dynamic change of PDF page orientation PD4ML
Posted: 15 Mar 2010, 14:14 |
|
|
Unfortunately currently there is no easy way to do that.
The horizontal margins (insets) impact HTML-to-PDF scale factor: scale = (pageFormat.width - insets.left - insets.right) / htmlWidth so a lot of flexibility in page-specific margins definitions could cause undesired drawbacks.
However a swap of insets.left and insets.right depending on odd or even page seems to be doable and harmless. And I guess the limited feature would be sufficient for your case.
We are ready to add it to our API. The implementation priority would depend on the PD4ML license type you own / are going to order. Please contact PD4ML support by email.
|
|
| |
 |
Subject: Re: Dynamic change of PDF page orientation |
|
|
Thanks for the reply. We are planning to go in for PD4ML Pro license.
I have another query. I have a report in which we go in for landscape.
We develop the report in html and then using PD4ML try to convert to pdf. But the font and everything appears to be big when we go and change the page oreintation to suit landscape. The code for the same is given below.
PD4ML pdf = new PD4ML(); pdf.setPageSize(new Dimension(842,595));
How can we sort it out? Thanks in advance.
|
|
| |
 |
Subject: Re: Dynamic change of PDF page orientation PD4ML
Posted: 15 Mar 2010, 18:25 |
|
|
As I wrote before the scale factor is computed this way: scale = (pageFormat.width - insets.left - insets.right) / htmlWidth
In your case a switch from portrait to landscape means change of pageFormat.width from 595 to 842. You need to correspondingly/proportionally increase htmlWidth parameter.
|
|
| |
 |

|
 |
 |
|
 |
Copyright ©2004-10 zefer|org. All rights reserved. |
|
|
 |
|
 |