Aspose Tagged PDF add content at specific page

Hi Aspose,

Is there a way to add an empty first page to the existing tagged pdf (loaded from stream) and add elements to the newly created page?

I have 4 pages of tagged pdf document, now i would like to add a cover page to it and add tagged content in the cover page

@Arjun7766

I request you to refer to following articles and share your feedback.

I am able to add a new page, but If I am trying to add any new tagged content (paragraph) to the new page it was added at the end (last page) I tried to add a new paragraph to the first child element but it was still appending paragraph at the last page. Please verify the below code and please let me know what changes are required. I am able to add content by converting pdf to word and merging using pdffileformat but in this case all the tagged content is getting un tagged.

// Open document
Document document = new Document(taggedPdfStream);

// Insert a empty first page in a PDF
document.Pages.Insert(1);

// Get Content for work with TaggedPdf
ITaggedContent taggedContent = document.TaggedContent;
var rootElement = taggedContent.RootElement;

//create tagged paragraph
ParagraphElement paragraphElement = taggedContent.CreateParagraphElement();
paragraphElement.SetText("Lorem ipsum dolor sit amet, consectetur adipiscing elit. ");
 
//I have tried to append paragraph elements like below but in both scenarios
//it is appending element on the last page, so here I would like to
//this paragraphElement element to the first page

rootElement.AppendChild(paragraphElement);
 
rootElement.childElements[0].AppendChild(paragraphElement);

@Arjun7766

Can you please share the source file and generated PDF. We will be able to investigate that on our end on provision of requested information.

I have the exact same problem, and it is pretty annoying to always see answers like “can you share this, and can you share that?”. You never actually answer anything.

When you create tagged content, how do you control which page it appears on? Can you please answer that without me having to share god knows what?

@Frank_Bertelsen

We are preparing a code example for this requirement under the task ID PDFNET-52301. As soon as the task is completed, we will share information with you.

Please accept our humble apology if any of our responses felt unpleasant. We only ask for sample files (e.g. source and expected output) when some requirements need to be investigated whether they can be achieved or not. We could try to create an expected output PDF based on our assumption but keeping PDF format in view, we could not really say that two apparently identical PDF files are the same. They could differ in many ways in their structures and element sequences.

Above are some main factors and reasons why we mostly request to share a sample document or expected output or anything else related to a code snippet and environment details. Nevertheless, we will soon get back to you as soon as the code sample is ready.

Hi Team,
Is this feature implemented yet?

@abrahamaby

Regretfully, the feature is not yet implemented. Your concerns have been recorded and we will surely inform you once we have some updates regarding ticket implementation. Please spare us some time.

We are sorry for the inconvenience.