|
Rank: Newbie Groups: Member
Joined: 9/29/2015 Posts: 3
|
Hi,
I have a problem, How can i have multiple outputarea's within 1 document conversion?
Problem: i have a (dynamicaly created) html where i don't know how long it will be. The first page should be starting with a topmargin of 0.5F and all other pages with 2.5F
But i really don't know how to do this. i tried with BeforeRenderPage or AfterRenderPage and then reset the outputarea after the first page is generated, but it doesn't work that way i guess.
thanks for the help! Kenny
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, You can do something like this:
Code: C#
//This set the OutputArea to have a 2.5f top margin for all pages
HtmlToPdf.Options.OutputArea = new RectangleF(1f, 2.5f, 6.5f, 7.5f);
//This explicitly set the start position for the first page as
//2.5f + (-2) = 0.5f
HtmlToPdf.Options.StartPosition = -2;
The second line is the key. Please let us know if this works for you. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 9/29/2015 Posts: 3
|
Hello, I tried this, and it works, only it will break my page t0o early (there is a white margin of 2 on the bottom of the first page. I would like to have a full page, where the outputarea of the first page is RectangleF(0.5F, 0.5F, 7.4F, 10.5F) and of all the next pages RectangleF(0.5F, 2.5F, 7.4F, 8.5F)
But it is a start, so thanks for this solution.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
We have looked into this and it would require code changes on our end. We will make the change and post a new build either later this week or early next week. After that you will be able to use the same code to achieve the expected result.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 9/29/2015 Posts: 3
|
Thank you very much! Can you keep in touch for this release?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
This is just to let you know that we have posted a new build that supports this. You can download the new build from the download page. The code will still be the same (using negative StartPosition).
Thanks!
|
|