Hi Vladimir,
Thank you for contacting Syncfusion support.
We can get the last page of the PDF document by using PdfLoadedPageCollection.PageCount property, we have created a sample for inserting PdfTextElement in bottom of the last page for your reference, please refer the below code snippet and sample for more details.
//Load the existing PDF document
PdfLoadedDocument ldoc = new PdfLoadedDocument("../../Barcode.pdf");
//Get the PDF document page count
int pageCount = ldoc.Pages.Count;
//Get the last page
PdfLoadedPage lastPage = ldoc.Pages [pageCount-1] as PdfLoadedPage ;
//Create a new PDF text element
PdfTextElement lastPageElement = new PdfTextElement("This is the last page", new PdfStandardFont(PdfFontFamily.Helvetica, 15, PdfFontStyle.Bold), PdfBrushes.Red);
//Draw the text element to the last page of the document
lastPageElement.Draw(lastPage.Graphics, new System.Drawing.PointF(0, lastPage.Size.Height - 20));
//Save the document
ldoc.Save("output.pdf");
//Close the document
ldoc.Close(true); |
Sample Link:
Let us know if you have any concern.
Regards,
Chinnu