Hi there, I am writing a small program at the moment to automatically fill forms in a PDF. PDFSharp cannot properly flatten forms at this times so I figured I would write my own workaround for it. I decided I would make use of the DrawString method, as I can get the position of where the string can be placed from the Rectangle of the TextField. I can also get the Font Name, Font Style and Font Size properties from the .Font member of the TextField, which you can see in the following code:
Code:
struct Font
{
public string Name;
public string Style;
public double Size;
}
fontDetails.Name = currField.ContentFontName.ToString();
fontDetails.Size = currField.Font.Size;
I was also hoping to be able to find out the Alignment of the TextField so that I can properly Left, Center or Right justify the string with the XStringFormats parameter of DrawString().
Is there a way to find the alignment of a Field?
Thanks, RBrNx