Free Support Forum - aspose.com

Extract/Read XFA field value in PDF using Aspose.PDF for .NET - extracted value is empty

Hi,
I’m facing an issue with the function Aspose.Pdf.InteractiveFeatures.Forms.Field.Value. In the attached pdf file, the field OICRINSTINTER-I_ACT_ANIMAUX has a default value “chien”. The function “Forms.Field.Value” does not return this value “chien”, it returns nothing.

could you, please, tell me how i can get this value ?

Actually, I’m evaluating your product. I really need this function to work properly. I will not by your component if this function does not work.

thanks.

Hi Fabien,


Thanks for your interest in our products.

I am afraid I could not find the attachment with your earlier post. Can you please again attach the document so that we can test the scenario at our end. We are sorry for your inconvenience.

Hi Fabien,


Thanks for sharing the resource files.

I have tested the scenario using Aspose.Pdf for .NET 7.6.0 and as per my observations, the field value is properly being returned as chien

[C#]

//Instantiate Form object<o:p></o:p>

Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();

// bind the source PDF file

pdfForm.BindPdf("c:/pdftest/Field_Value.pdf");

// get the value of field name

Console.WriteLine("Field
Value : {0} "
, pdfForm.GetField(“formulaire1[0]”));

Thanks for your answer.

Could you send me a new temporary key as soon as possible ?

I can't verify this with Aspose.PDF .NET 7.6.0 because my key has expired.

Fixing bugs that i opened is a prerequisite to the purchase of your component.Could you communicate a date for correction of all bug that i opened ?

Thanks.

fabien.violeau:
Could you send me a new temporary key as soon as possible ?

I can’t verify this with Aspose.PDF .NET 7.6.0 because my key has expired.

Hi Fabien,

Please visit the following link for instructions on how to Get a temporary license

fabien.violeau:
Fixing bugs that i opened is a prerequisite to the purchase of your component.Could you communicate a date for correction of all bug that i opened ?

Each and every issue noticed in our product is equally important for us; however sometimes some issues get high priority in terms of resolution due to their severity and due to the fact that they are reported by customer with Priority or Enterprise support.

Can you please share the ID’s of issues which you have reported, as it will help us to get their current status.

Hi,

ID's of issues are :

PDFNEWNET-34510

PDFNEWNET-34628

PDFNEWNET-34702

Can you tell me their current status and an estimated resolution date ?

fabien.violeau:
PDFNEWNET-34510

Hi Fabien,

I am pleased to share that the above stated issue is resolved and its hotfix will become available in Aspose.Pdf for .NET 7.7.0 which is planned to release in current month.

fabien.violeau:
PDFNEWNET-34628

The document which you have shared contains static form (i.e. form has XFA). When you are adding the pages of this document to new document, data of XFA form are lost. This causes changing of field appearance.
To correctly move data we have introduced a new method AssignXfa method which will become available in next release version of Aspose.Pdf for .NET 7.7.0. Once the new version becomes available, we would be more than happy to update you with the status of availability.

fabien.violeau:
PDFNEWNET-34702

As we recently have noticed this issue, so until or unless the development team has investigated and figured out the reasons of this problem, we might not be able to share the timeliness regarding its resolution. Please be patient and spare us little time. We are sorry for your inconvenience.

Thank you for your reply.

We will buy your component, but we will wait this release (Aspose PDF for .NET 7.7.0) and check the point PDFNEWNET-34628 before buy.

Hi Fabien,


As soon as the above stated issues are resolved and hotfix becomes avaialble, we would be more than happy to update you with the status of correction. Your patience and comprehension is greatly appreciated in this regard.

Hi Fabien,


Thanks for your patience. I am pleased to share that the issue PDFNEWNET-34510 reported earlier has been resolved and its hotfix will be available in upcoming release version of Aspose.Pdf for .NET 7.7.0.

1. In resultant file, the fields are moved correctly (you can ensure it if set border to fields:

textBoxField.Rect = new
Aspose.Pdf.Rectangle(llx, lly, urx, ury);<o:p></o:p>

textBoxField.Border = new Border(textBoxField);

textBoxField.Border.Width = 1;

textBoxField.Characteristics.Border = System.Drawing.Color.Black;

2. But if open the form in LyfeCycle we'll see that fields are not moved. In order to update data of XFA form customer additionally should update field template:

//get list of field templates from XFA form

XmlNodeList templates = pdfDocument.Form.XFA.GetFieldTemplates();

foreach (string formField in listFields)

{

//get a field

TextBoxField textBoxField = pdfDocument.Form[formField] as TextBoxField;

//modify field location

textBoxField.Rect = new Aspose.Pdf.Rectangle(llx, lly, urx, ury);

foreach (XmlNode template in templates)

{

if (template.Attributes["name"].Value + "[0]" == textBoxField.PartialName)

{ template.Attributes["x"].Value = llx + "px"; template.Attributes["y"].Value = lly + "px"; template.Attributes["w"].Value = (urx - llx) + "px"; template.Attributes["h"].Value = (ury - lly) + "px"; }

}

llx = llx + 100;

lly = lly + 100;

urx = urx + 100;

ury = ury + 100;

}

3. Visible fields border are drawn in page contents with graphic operators. It seems we need to paint fields and their names with operators in page contents and clear old page contents because Adobe LifeCycle do this when fields were changed.

This document has static form. Data of XFA form are updated when AcroForm field is changed, and appearance of the fields on the page is change appropriately (as Adobe LifeCycle does).

fabien.violeau:
We will buy your component, but we will wait this release (Aspose PDF for .NET 7.7.0) and check the point PDFNEWNET-34628 before buy.

Hi Fabien,

As shared earlier, the document which youahve shared contains static form (i.e. form has XFA). When you have added pages of document into new document, data of XFA form is lost. This causes changing of field appearance. In order to correctly move data, you need to use AssignXfa method. Please try using the following code snippet with Aspose.Pdf for .NET 7.7.0

See attached 34628.pdf file generated with below specified code.

[C#]

Document currentPdfDocument;<o:p></o:p>

currentPdfDocument = new Aspose.Pdf.Document("c:/pdftest/JSOU-9-1-20121212143830-debug-copy-2-before-rename.pdf");

Document targetDoc = new Aspose.Pdf.Document();

targetDoc.Pages.Add(currentPdfDocument.Pages);

//copy XFA data from old document to new

targetDoc.Form.AssignXfa(currentPdfDocument.Form.XFA.XDP);

targetDoc.Save("c:/pdftest/34628.pdf");

The issues you have found earlier (filed as PDFNEWNET-34510;PDFNEWNET-34628;PDFNEWNET-34702) have been fixed in Aspose.Pdf for .NET 7.7.0.


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