Aspose.Pdf.Facades.FormFieldFacade.Rotate set now working

Hi,

Aspose.PDF 22.7
I am populating fields in a pdf using Aspose.Pdf.Facades.FormFieldFacade
The document page is rotated 180 degrees, so to make the text look the correct way up I need to rotate the facade by 180 degrees.

Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form(inputStream);

foreach (string fieldName in fieldNames)
{
form.GetFieldFacade(fieldName).Rotation = 180;
form.FillField(fieldName, “TEST”);
}

namespace Aspose.Pdf.Facades
{
public sealed class FormFieldFacade
{
public int Rotation { get; set; }

However, rotation is still 0 when execution gets to form.FillField(fieldName, “TEST”);.

Is this a bug in 22.7 or is there another way to set the rotation?

@peter.purnell

It seems that you are experiencing an issue with the Rotation property of the FormFieldFacade class not being applied as expected when filling the field in your PDF document.

In your code, you are correctly setting the Rotation property to 180 degrees for each field before calling FillField. However, if the Rotation property is still showing as 0 during the execution of FillField, it may indicate that the rotation setting is not being applied correctly or is being reset before the field is filled.

Here are a few suggestions to troubleshoot and potentially resolve the issue:

  1. Check for Updates: Ensure that you are using the latest version of Aspose.PDF. Sometimes, bugs are fixed in newer releases, so upgrading to a more recent version than 22.7 might resolve the issue.

  2. Set Rotation After Field Retrieval: Make sure that the Rotation property is set immediately before calling FillField. This ensures that the property is applied to the field right before it is filled.

  3. Debugging: Add debugging statements to check the value of the Rotation property right before the FillField call. This will help confirm whether the property is being set correctly.

  4. Alternative Methods: If the issue persists, consider using other methods to manipulate the field’s appearance after filling it, such as applying transformations directly to the PDF document or using a different approach to set the rotation.

If none of these suggestions resolve the issue, it may be beneficial to reach out to Aspose support for further assistance, as it could be a bug specific to the version you are using.

If you have any further questions or need additional assistance, feel free to ask!