Hello Aspose team,
I would like to create a PDF/UA file. This document consists of several parts, a letter with the sender, a logo and a table over several pages. I managed to create all of these parts and they passed the corresponding tests.
But what I couldn’t manage is the correct positioning of the elements.The logo should be exactly in the middle on top of each page, parts of the text should be on the right edge but left-justified and so on. How can I set the position of tagged content?
I found the structured attribute placement. But with that I didn’t manage to position the object. If I set the value nothing happens. I’ve tried several variants. My last one looks like this:
FigureElement figureelement = taggedContent.CreateFigureElement();
figureelement.SetImage(“Logo.png”, 100, 100);
figureelement.AlternativeText= “Hello world”;
StructureAttributes layoutAttributes = figureelement.Attributes.GetAttributes(AttributeOwnerStandard.Layout);
StructureAttribute placementAttribute = new StructureAttribute(AttributeKey.Placement);
placementAttribute.SetNameValue(AttributeName.Placement_Start);
placementAttribute.SetRectangleValue(new Aspose.Pdf.Rectangle(300, 300, 400, 400));
layoutAttributes.SetAttribute(placementAttribute);
What am I doing wrong? How do I set the position of text, tables and images?