Hi, I developed some code to create a pdf file from scratch, I use object like:
TextSegment
FloatingBox
TextFragment
Line
Image
everything is seen correctly inside the pdf. Now I would like to modify the code to make it tagged, so as I insert these elements into the pdf I would also like to insert them into the tag structure.
How can I do it?
Example:
FloatingBox floatingBox = new FloatingBox();
floatingBox.setLeft(x);
floatingBox.setTop(y);
floatingBox.setWidth(width);
floatingBox.setHeight(height);
com.aspose.pdf.MarginInfo margin = new com.aspose.pdf.MarginInfo(leftPadding, bottomPadding, rightPadding, topPadding);
floatingBox.setPadding(margin);
floatingBox.setVerticalAlignment(verticalAlignment);
floatingBox.setHorizontalAlignment(horizontalAlignment);
com.aspose.pdf.TextFragment fragmentColl = new com.aspose.pdf.TextFragment();
TextSegmentCollection sc = fragmentColl.getSegments();
if(lstTextSegment != null && lstTextSegment.size() > 0) {
for (int i = 0; i < lstTextSegment.size(); i++) {
com.aspose.pdf.TextSegment segment = lstTextSegment.get(i);
sc.add(segment);
}
floatingBox.getParagraphs().add(fragmentColl);
}
currentAsposePage.getParagraphs().add(floatingBox);
where and how can I act in this piece of code to set the graphic elements to ARTIFACT and tag the text? then create a link between the element inserted in the pdf and the tag structure
Grazie.