Issue with Aspose PDF .Net

I am using Aspose PDF with version 24.3.0 and processing the html to pdf. I am setting some margin at top for every page while PDF creation.
I am applying a page break at page 6, my content is successfully moved to page 7,
but margin which I have set is not applied moreover, some content on page 7 is moved to page 8 while there is still space left on page 7.

Here is my sample code:
var pdfDoc = new Document(“\Users\Desktop\1596_1.pdf”);
pdfDoc.ProcessParagraphs();
PdfFileEditor fileEditor = new();
MemoryStream streamPageBreak = new();
TextFragmentAbsorber absorber = new(“Section PDF 3”)
{
TextSearchOptions = new TextSearchOptions(true)
};
pdfDoc.Pages.Accept(absorber);
TextFragment textFragment = absorber.TextFragments[1];
fileEditor.AddPageBreak(memory, streamPageBreak, new PdfFileEditor.PageBreak[]
{
new PdfFileEditor.PageBreak(textFragment.Page.Number, textFragment.Rectangle.URY - 1)
});

pdfDoc = new Document(streamPageBreak);
pdfDoc.Save(“\Users\Desktop\P5.pdf”);

@prashantm1989

Would you please share your sample source and output PDF for our reference as well? We will test the scenario in our environment and address it accordingly.

Hi,

Please find the attached files. File 1596_1 is the original pdf and P5 is after page break.
1596_1.pdf (170.1 KB)

P5.pdf (51.6 KB)

@prashantm1989

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-57173

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.