The error message you are facing is due to trial version limitation of the API. In order to evaluate API without any restrictions, please try to use a valid license or consider applying for a 30-days free temporary license. In case you still face any issue, please feel free to let us know.
I have attached the PDF,
I am trying to PageBreak after certain headings, like “Heading level 1” and “Heading level 2”.
My heading title for PageBreak are fix, however the size of content between headings varies
We were able to notice the issue in our environment that AddPageBreak method was not generating correct result. We have logged an issue as PDFNET-47854 in our issue tracking system for the sake of further investigation. We will look into details of it and keep you posted with the status of its correction. Please be patient and spare us little time.
We tested the scenario using following code snippet with your PDF document and it generated a result where all text was upside down in resultant PDF.
Document doc = new Document(dataDir + "Pagebreaktest.pdf");
var finder = new TextFragmentAbsorber("Heading level 1");
doc.Pages.Accept(finder);
TextFragment text = finder.TextFragments[1];
Facades.PdfFileEditor fileEditor = new Facades.PdfFileEditor();
fileEditor.AddPageBreak(dataDir + "Pagebreaktest.pdf", dataDir + "PageBreakWithDestPath_out.pdf", new Facades.PdfFileEditor.PageBreak[]
{
new Facades.PdfFileEditor.PageBreak(1, text.Position.YIndent)
});
Please note that same code snippet worked fine with one of our sample PDF documents. May be you can try it with some other PDF file at your side. The issue has been logged for your particular PDF file and we will surely inform you as soon as it is resolved.
Regarding HTML to PDF conversion, following CSS property can put Page Break inside PDF if it is used in the source HTML:
page-break-before: always;
In case of any further inquiry, please feel free to let us know.
It is good to know that suggested solution worked for you. Please keep using our API and in case you need further assistance, please feel free to let us know.
As the issue was logged under free support model, we are afraid that it is not resolved yet and it has low priority. We will surely inform you as soon as we have some definite updates regarding its resolution. Please spare us some time.