Free Support Forum - aspose.com

Alignment of fields

Hello,
Pardon me, I am a newbie.

I am using Aspose to create a pdf file with lots of fields. My problem is that the fields populated with a object is right aligned and needs to be left aligned (which overrides Acrobat field settings?). I found the AlignmentType to make left but I am not sure where to put AlignmentType.Left. Here is the code where the fields get collected. I am assuming it is on the field variable.


public override Dictionary GetDocumentFieldValues(string documentLocation) {
// Base class validates document
base.GetDocumentFieldValues(documentLocation);

// Create Aspose.PDF.Kit PDF Form
Form pdfForm = new Form(documentLocation);
if (pdfForm == null)
return null;

Dictionary fieldValues = new Dictionary();
foreach (string field in pdfForm.FieldNames) {
string value = pdfForm.GetField(field);
fieldValues.Add(field, value);

Hi Diane,

Thanks for your interest in our products. As far as I can see, you are trying to align the fields inside a PDF document already created. If so is the case, then in order to align the form fields, please try using Alignment property of FormFieldFacade class and try using the value AlignLeft value from FormFieldFacade enumeration. I would also recommend you to please visit the following links for more information on
Decorate All Fields of a Particular Type in an Existing PDF File (Facades)

In case it does not satisfy your requirement or you have any further query, please feel free to contact.

Very helpful. Thank you!