Welcome Guest Search | Active Topics | Sign In | Register

EO.PDF paging Options
quirtep
Posted: Monday, June 13, 2011 9:06:29 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
I set a report that uses EO PDF to HTML. For the comments area on the bottom, I put it inside a <div style="page-break-inside: avoid">. Still, the comments are split to two pages - the break happens right in the middle of the comments...
eo_support
Posted: Monday, June 13, 2011 9:37:24 AM
Rank: Administration
Groups: Administration

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

Please try to update to the latest version first. We have recently fixed a few issues about manual paging. So it might have already been fixed.

Thanks!
quirtep
Posted: Monday, June 13, 2011 9:43:50 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
I did try that already.
eo_support
Posted: Monday, June 13, 2011 9:48:22 AM
Rank: Administration
Groups: Administration

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

In that case please try to isolate the problem into a test project and send it to us. We will debug it here and see what we can find.

Thanks!
quirtep
Posted: Wednesday, June 15, 2011 8:45:28 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
The html page I am trying to convert can be seen here:

http://educatorsa3.web703.discountasp.net/protected/Report.aspx?id=20677

If you look at the source code, you will see that the Comments area is wrapped inside a <div style="page-break-inside: avoid">.

Here is what happens when it is converted to PDF:

http://educatorsa3.web703.discountasp.net/protected/ReportPDF.aspx?id=20677

Here's the entirety of the code used for the conversion:

protected void Page_Load(object sender, EventArgs e)
{
string strReportPageName = "Report";
if (Request["rpn"] != null)
strReportPageName = Request["rpn"].ToString();

if (Request["id"] != null)
{
PdfDocument doc = new PdfDocument();
string strURL = "http://" + HttpContext.Current.Request.Url.Host + "/protected/" + strReportPageName + ".aspx?id=" + Request["id"].ToString();
HtmlToPdf.ConvertUrl(strURL, doc);
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.ClearHeaders();
response.ContentType = "application/pdf";
doc.Save(response.OutputStream);
Response.End();
}
}
eo_support
Posted: Wednesday, June 15, 2011 5:25:27 PM
Rank: Administration
Groups: Administration

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

We have posted build .46 that should fix this problem. Please download the new build from the download page.

Thanks!
quirtep
Posted: Thursday, June 16, 2011 7:52:02 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
Thanks. It's closer, but it still breaks between the word "Comments" and the actual comments, even though I have the header and actual comments wrapped inside a <div style="page-break-inside: avoid">.
eo_support
Posted: Thursday, June 16, 2011 8:11:53 AM
Rank: Administration
Groups: Administration

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

We verified your test page with our online demo and it worked fine:

http://www.essentialobjects.com/Products/EOPdf/UrlToPdf.aspx

Thanks
quirtep
Posted: Thursday, June 16, 2011 8:19:34 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
It does the exact same thing when you verify the test page I provided with your online demo. There should be no page break between the word "Comments" and the comments themselves.

Again, here is my test page:

http://educatorsa3.web703.discountasp.net/protected/Report.aspx?id=20677

Using either your online demo or my own script, it does the same thing. I am not making it up.
eo_support
Posted: Thursday, June 16, 2011 8:49:43 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
I see what you meant. That's a problem. We will look into it and get back to you as soon as possible.

Thanks
quirtep
Posted: Thursday, June 16, 2011 8:51:03 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
Cool. Thanks. At least I'm not going crazy. I shall be patient. :)
eo_support
Posted: Thursday, June 16, 2011 9:02:31 AM
Rank: Administration
Groups: Administration

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

We looked into the page and our HTML to PDF is correct. The reason is because both main_divComments and main_divComments2 are float, so their parent DIV actually has a size of (0, 0), which means even though logically the parent DIV contains those two child DIVs, visually they do not. This is the same idea as a parent DIV contains absolute positioned child DIVs. page-break rules are based on element's position and size, not their parent child relationship. Parent/child relationship is direct factor for the layout engine, but not a direct factor for paging.

Thanks
quirtep
Posted: Thursday, June 16, 2011 9:25:37 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
Cool. I guess that makes sense, and indeed just using float on the parent div fixed the issue. Thanks!


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.