Insert an Empty Page into a PDF File at the first page

Hi Team

I have used in few app the aspose, in one of my case I would like to know hot to add a empty PDF page at a particular page given, for now I'm able to add the Empty page at the last of the PDF Selected.




Will it be possible to add Bookmark for a selected page and add Data to it Dynamically like the ms word.
(MSWord im able to add Bookmark and use it throughout any page.)


Thanks and Regards
Ramu S

Hi Ramu,

Thanks for your inquriy. you can easily insert an empty page to desired index and you can also add data to it and add bookmark for the page as following. Hopefully it will help you to accompmish the task.

//Open the document
Document pdfDocument1 = new Document("Input.pdf");
Aspose.Pdf.Page page=pdfDocument1.Pages.Insert(2);
TextFragment text = new TextFragment("test page");
page.Paragraphs.Add(text);
// Create a bookmark object
OutlineItemCollection pdfOutline = new OutlineItemCollection(pdfDocument1.Outlines);
pdfOutline.Title = "Test Outline";
pdfOutline.Italic = true;
pdfOutline.Bold = true;

// Set the destination page number
pdfOutline.Action = new GoToAction(page);

// Add bookmark in the document's outline collection.
pdfDocument1.Outlines.Add(pdfOutline);

//Save output file
pdfDocument1.Save("output.pdf");

Please feel free to contact us for any further assistance.

Best Regards,

Thanks for the Quick response.


The solution given works fine.

Hi Ramu,


Thanks for your feedback. It is good to know that suggested solution worked for you.

Please keep using our APIs and feel free to contact us for any further assistance.

Best Regards,