Hi Aspose Support,
I am using the following code to display divElement but i am not able to see anything in the generated pdf. Please let me know mistakes if any in the code and suggest the correct code.
Code
DivElement divElement = taggedContent.createDivElement();
taggedContent.getRootElement().appendChild(divElement);
I create a very simple document with the following code:
C#
private void Logic()
{
Document document = new Document();
ITaggedContent taggedContent = document.TaggedContent;
taggedContent.SetTitle("PDF with Tagged Content");
taggedContent.SetLanguage("en-US");
DivElement divElement = taggedContent.CreateDivElement();
taggedContent.RootElement.AppendChild(divElement);
// Save PDF Document
document.Save($"{PartialPath}_output.pdf");
}
The code in java:
public void Logic() throws Exception
{
var doc = new com.aspose.pdf.Document();
ITaggedContent taggedContent = doc.getTaggedContent();
taggedContent.setTitle("PDF with Tagged Content");
taggedContent.setLanguage("en-US");
DivElement divElement = taggedContent.createDivElement();
taggedContent.getRootElement().appendChild(divElement);
doc.save(PartialPath + "_output.pdf");
}
The output:
AddingDiv_output.pdf (3.0 KB)