Currently using Aspose.Pdf and trying to produce PDFs from dynamically-generated HTML. As the html is dynamic, we can’t really decide in advance where we want to put page breaks in.
Inline and via CSS at the top of the file. However, Aspose seems to still just put page breaks right through elements.
I’ve also looked at manipulating the generated Section/table paragraph structure somehow, but the structure doesn’t seem to wrap divs very well - most of the elements are all in one cell’s Paragraphs.
Is there any way we can prevent Aspose page-breaking right through the middle of divs?
I will appreciate if you please share some of the sample generated HTML string / file along with the sample code you are using to convert it into the PDF file. It will help us to understand your requirement exactly and address it accordingly.
We're just writing the html file to a stream, and outputting it as a stream which we later write to a pdf file. It creates the PDF fine, but when you try it you can see the output doesn't look good because the div with class 'control' can get split over multiple pages. The page doesn't break well. As I mentioned earlier, the process of generating this html is dynamic so it would be exceptionally difficult to insert page breaks in the correct places even if they worked.
I have tested the scenario and have managed to reproduce the problem that the generated PDF doesn’t break well. For the sake of correction, I have logged a ticket PDFNET-42500 in our issue tracking system. We will further look into the details of the problem and will keep you updated within this forum thread on its resolution. Please be patient and spare us little time. We are sorry for the inconvenience.
Another ticket as PDFNET-51824 has been logged in our issue tracking system dedicated for adding support of mentioned CSS Property. We have linked it with this forum thread so that you would receive a notification as soon as it is added. Please be patient and spare us some time. We are sorry for the inconvenience.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.