FormField Dimensions in Pdf

Hi,

Is there a way to control the height and/or width of a text input Form Field that is created when saving to a Pdf file, using the “legacy” pdf save method? I’m inserting a text Form Field using the “InsertTextInput” method and it seems that, regardless of the font size used, the text input is always the same height when viewed in Adobe Reader. This causes problems when the font is too large for the height of the input box, as you cannot see the text being typed in. I would have expected the height to automatically stretch to fit the font being used.

Thanks

Hi

Thanks for your request. As you may know, currently Aspose.Words supports two ways of PDF conversion.

Unfortunately, the direct method does not support PDF Form Fields yet. I linked your request to the appropriate issue. You will be notified as soon as this feature is supported.

Regarding the “legacy” method, I think you should ask this question in Aspose.Pdf forum. As I can see, Aspose.Words output font size of formfield correctly into the intermediate XML. I used the following code for testing:

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

FormField field = builder.InsertTextInput(“test”, TextFormFieldType.RegularText, “”, “test”, 0);

field.Font.Size = 24;

doc.SaveOptions.PdfExportFormFieldsAsText = false;

doc.SaveOptions.ExportPrettyFormat = true;

doc.Save(@“Test001\out.xml”, SaveFormat.AsposePdf);

Here is XML produced by this code:

<?xml version="1.0" encoding="UTF-8"?>

Best regards.

The issues you have found earlier (filed as 6798) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(52)