Welcome Guest Search | Active Topics | Sign In | Register

Text alignment using "low level" api Options
Dfects
Posted: Thursday, May 2, 2013 11:29:00 AM
Rank: Newbie
Groups: Member

Joined: 5/2/2013
Posts: 8
Hiya,

I'm trying to figure out how I can set text alignment (left, centre, right) using the low level API. A snippet of my code is below:

Quote:

var textLayer = new PdfTextLayer {
Font = new PdfFont(fieldDescription.FontFace.ToString(), fieldDescription.FontSize)
};

var textContent = new PdfTextContent("Hello World!");
textContent.PositionMode = PdfTextPositionMode.Offset;
textContent.Offset = new PdfPoint(300, 400);

var convertFromString = new ColorConverter().ConvertFromString(fieldDescription.FontColour);
if (convertFromString != null) {
textContent.NonStrokingColor = (Color)convertFromString;
}

textLayer.Contents.Add(textContent);

page.Contents.Add(textLayer);


Any ideas?
eo_support
Posted: Thursday, May 2, 2013 11:34:56 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

You can not do that with PdfTextLayer/PdftextContent. The low level content API does not do run any layout logic. The Html to PDF converter, and the PDF Creator API (AcmXXXX objects) can do layout.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.