Welcome Guest Search | Active Topics | Sign In | Register

Problem HtmlToPDF Options
Fractus
Posted: Wednesday, May 20, 2015 3:53:04 PM

Rank: Member
Groups: Member

Joined: 9/3/2013
Posts: 16
Hi,

Im using EO.PDF v.5.0.84.2 in SharePoint 2010. Im having problems rendering the second page, it only shows 1 page and the rest is appering like "overflow" without second page. I event try to add a page-break-after: always in a late div, but only renders 1 page.

MemoryStream pdfStream = new MemoryStream();
EO.Pdf.Runtime.AddLicense("");
HtmlToPdf.Options.PageSize = EO.Pdf.PdfPageSizes.A4;
HtmlToPdf.Options.MinLoadWaitTime = 5000;
HtmlToPdf.Options.PageSize = new System.Drawing.SizeF(PdfPageSizes.A4.Height, PdfPageSizes.A4.Width);
HtmlToPdf.Options.AutoFitX = HtmlToPdfAutoFitMode.ShrinkToFit;
HtmlToPdf.Options.AutoFitY = HtmlToPdfAutoFitMode.None;
HtmlToPdf.Options.OutputArea = new RectangleF(0.25f, 0.25f, 10.75f, 8.0f);
HtmlToPdfResult oResultHtmlToPdf = HtmlToPdf.ConvertUrl(, pdfStream);

Fractus - Developer & Consulting
eo_support
Posted: Thursday, May 21, 2015 11:32:29 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

Please check if you have any page-break-inside: avoid in your HTML. If you have page-break-inside:avoid, then the converter won't break a page and whatever can not fit on the page will just be cut off.

Note that two overlapping page-break-inside: avoid can combine into a big unbreakable section. For example:

Code: HTML/ASPX
<div style="width:100px;height:500px;page-break-inside:avoid;"></div>
<div style="width:100px;height:500px;margin:-1px;page-break-inside:avoid;"></div>


If the page height is 800 pixels, then the second DIV will be cut off (you might think it should break at the begining of the secondDIV). This is because two DIVs will combine into a single 999 pixels unbreakable block because they overlap.

If that is not the problem, you can try the latest build and see if it works for you. We did fix some page-break related issue that deals with some rare cases in the latest build.

If the latest build still does not resolve the issue, you can try to isolate the problem into a test project and send us the test project. Once we have that we will be happy to look further. See here for more information on how to submit test project:

http://www.essentialobjects.com/forum/test_project.aspx

Thanks!
Fractus
Posted: Monday, May 25, 2015 3:00:45 PM

Rank: Member
Groups: Member

Joined: 9/3/2013
Posts: 16
Same effect adding the page break with the last version. Because its a sharepoint implementantion I cannot share the project, but I add the HTML with the CSS and the resulting PDF.
https://www.dropbox.com/s/il29d8fvinuoi24/Project.zip?dl=0

Fractus - Developer & Consulting
Fractus
Posted: Tuesday, May 26, 2015 11:22:15 AM

Rank: Member
Groups: Member

Joined: 9/3/2013
Posts: 16
I found the solution, automatically SharePoint add a height to the div s4-workspace and the calculated height was 485px, I added this CSS and the multiple page work perfectly.

body #s4-workspace {
height: inherit!important;
}

Fractus - Developer & Consulting
eo_support
Posted: Tuesday, May 26, 2015 2:11:09 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Great. Thanks for the update!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.