Flatten XFA Forms and Merge PDF Files using Aspose.PDF for Java - resultant file is not valid

shinkley:
Hi Nayyer, I can see about creating a simple form to highlight the problem for you. However, it is the same issue as described by Jeff above. Do you have any status on resolution for his issue?

I have spent some time doing a demo with iText, and this does not have the same limitation. I am able to form fill an XFA form, flatten the form to PDF, then merge additional PDFs as needed. Because of this, I do not think it is a limitation of my source XFA form or my additional PDF documents.
Hi Sean,

The earlier reported issue is still pending for review and is not yet resolved. However concerning to the issue which you are facing, we request you to please share the input file. We will further investigate the scenario from Aspose.Pdf perspective and will get back to you soon. We are sorry for this inconvenience.

Hi Nayyer,


In your source code to convert an XFA Form into an AcroForm, a NullPointerException is thrown at the line below.
<span style=“color: rgb(51, 51, 51); font-family: “Courier New”; font-size: 13.3333px; background-color: rgb(255, 255, 255);”>doc1.getForm().setType(com.aspose.pdf.FormType.Standard);

It generally means that doc1.getForm() is null. But it is not null in this case.
So you guys need to check the implementation logic of method setType(int type).

I tested with different input values for the type with <span style=“background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-family: “Courier New”; font-size: 13.3333px;”>com.aspose.pdf.FormType.Standard or <span style=“background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-family: “Courier New”; font-size: 13.3333px;”>com.aspose.pdf.FormType.Static, it throws the same error.
<span style=“background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-family: “Courier New”; font-size: 13.3333px;”>
<span style=“background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-family: “Courier New”; font-size: 13.3333px;”>Thanks.
<span style=“background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-family: “Courier New”; font-size: 13.3333px;”>
<span style=“background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-family: “Courier New”; font-size: 13.3333px;”>Jeff

Hi Jeff,


Thanks for contacting support.

The setType(…) method tries to convert the file to desired format and in case the operation is not completed successfully, an error occurs. However if you still need some improvement in this area, please share some further details and input files, so that we can further look into this matter.

We are sorry for your inconvenience.

I DO need the improvements in your APIs. I have given you all the input files for your trouble shooting in the tickets I created. As I described in my tickets, if either of the following can be resolved, our requirements will be met.

  1. merge two or more XFA forms into a single XFA form or AcroForm first and then flatten it into a plain pdf file.

  2. Flatten XFA forms into plain pdf files first and then merge the plain pdf files into a single plain pdf file.

Please do your best to resolve either of the issues above ASAP. Thanks in advance!

Jeff

Hi Jeff,


Thanks for contacting support.

The issue has been logged in our issue tracking system and your concerns are also recorded with product team. As soon as we have some definite updates regarding its resolution, we will let you know.

Hello,

Any update on resolving this issue?
For merging the flattened pdf files, if you want to convert the XFA forms into the AcroForm first and then do the merge, please consider the trimmed fields issue during the conversion. Please check the details in another ticket at

jeffguo:
Hello,

Any update on resolving this issue?
For merging the flattened pdf files, if you want to convert the XFA forms into the AcroForm first and then do the merge, please consider the trimmed fields issue during the conversion. Please check the details in another ticket at

Hi Jeff,

Thanks for your patience.

The product team has started investigating earlier reported issue but I am afraid its not yet resolved because its dependent upon its sibling in Aspose.Pdf for .NET project. However as soon as we have some definite updates regarding its resolution, we will let you know.

Now concerning to other issue mentioned above, we will keep you updated in respective forum thread.

Hello,


This is a critical and blocker issue to us,
If I create such a ticket for the Enterprise Support, will it be possible to speed up the issue-resolving process?

If the flattened pdf files are in the normal plain pdf format, the merging works correctly. The source of the issue is that the flattened files are NOT normal plain pdf files.

There may be two approaches to resolve the issue.
1. The best solution is that Aspose fixes the flatten method to output the normal plain pdf file. If so, merging files will automatically work without any issue.

2. If approach 1 is not doable, Aspose keeps the same way to flatten the XFA files. But the merging files issue should be fixed. If so, our users have to be forced to use the Adobe Reader as the pdf viewer in their browsers.


Jeff

Hi Jeff,


Thanks for contacting support.

When raising the priority of an issue to Enterprise Support, it do not guarantee an immediate resolution but it expedites the investigation process and issues logged under Enterprise Support and Priority Support have high precedence in terms of resolution as compared to issues logged under normal support.

Meanwhile I have logged your suggestions with earlier reported issue and we will consider them during the resolution of this problem.