|
Rank: Advanced Member Groups: Member
Joined: 6/19/2013 Posts: 38
|
Howdy, I moved my app onto my public server this weekend and the result of my ConvertHTML is noticeably different and also inconsistent. I set what I though were parameters to remove any such variability:
Code: Visual Basic.NET
Options.AutoAdjustForDPI = False
Options.ZoomLevel = 0.742
Options.AutoFitX = HtmlToPdfAutoFitMode.None
But the size of the content of the PDFs from the server is slightly bigger. Is there something else I should be doing to lock things down so I can get consistent results between computers? I am also intermittently encountering unexpected pagination. I suspect it may be related the above issue. The top of the second page has a page-break-before:always (to make it the second page.) The bottom 5 pixels or so of the first page will end up at the top of the second page about half the time. The layout of the two HTML files is identical, yet on some, part of the first page flows past the page break onto the next page. See the two links for PDFs that show the problem. I can supply the HTML if needed. BadFirstPage.PDFgoodFirstPage.PDFThanks! Brad
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
Try to increase HtmlToPdf.Options.MinLoadWaitTime and see if it helps. What can happen is, if you have some JavaScript code in your page that dynamically generates/modifies page contents, the converter wouldn't know when your code has finished done so. So the converter may cut in at one point during one conversion, and cut in at a different point during another conversion.
When the text is cut to the second page, it's usually because you have a zero or negative margin somewhere. So you may want to adjust your CSS to see if you can eliminate that.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 6/19/2013 Posts: 38
|
I am using a Manual Trigger mode to make sure all of my javascript is getting run, so I don't think it could be incomplete loading (the entire DOM is built using Javascript - Handlebars.js and lots of Bing Maps). Some of my HTML may take a 2 seconds to render, other can take a couple of minutes. so using MinLoadWaitTime is not viable solution which is why I opted for a Manual Trigger.
And it is just a few pixels of my Bing Maps Div plus the Div's bottom border that is getting pushed onto the next page, not a line of text or a whole element.
I do in fact use zero margins on the left and right. I am using StartPosition on the first page to make the top margin essentially zero as well. No negative margins. The effective bottom margin of the Output area I defined leaves a couple inches left over for the content on this page so the bottom of the element should be in no danger of getting sliced off.
Note that all of the page content below the map is a footer added later, so the map Div is the last element on this page.
Thanks, Brad
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
In that case I can not think of anything that can cause the text to be sliced off to the second page. If you can provide a test page, we will be happy to debug into it to see what we can find.
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
We have confirmed that this is a bug on our side and posted a new build that should fix this problem. Please see your email for the download location of the new build.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 6/19/2013 Posts: 38
|
Jack, once again you nailed it!
All working now.
- Brad
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Great. Thank you very much for confirming the fix!
|
|