Convert XFA pdf to a standard PDF

Hi Aspose,



We would like to have a solution for an existing issue created in your “public” forum.



The ID of the issue : PDFNEWNET-38460

In attach the XFA PDF.



The code used :





Aspose.Pdf.License licenceP = new Aspose.Pdf.License();

licenceP.SetLicense(@“C:\Users\x30358\PersonnelProject\TEST Conversion\TEST Conversion\Aspose.Total.lic”);





string fileName = @“C:\Users\Public\Documents\IconvertWatcher\Fiches Modulis fabien.pdf”;

string FileNameOut = @“C:\Users\Public\Documents\IconvertWatcher\Fiches Modulis fabien_Flatten.pdf”;



Aspose.Pdf.Document document = new Aspose.Pdf.Document(fileName);

document.Form.Type = Aspose.Pdf.InteractiveFeatures.Forms.FormType.Standard;

document.Flatten();

document.Save(FileNameOut);





Thanks.

Hi,


Thanks for contacting support.

I have tried viewing the PDF form shared in your first post but it appears to be infected as my antivirus is prompting for JS:Pdfka-gen [Expl] issue.
Can you please again try attaching the document, so that we can test the scenario in our environment. We are sorry for your inconvenience.

Hi,



In attachment the pdf requested.

Hi there,


Thanks for sharing your source document again. I have tested the scenario with Aspose.Pdf for .NET 11.1.0 and noticed that now API does not throws the exception, but resultant standard PDF form is not correct. So we have logged a ticket PDFNEWNET-40121 in our issue tracking system for further investigation and resolution. We will keep you updated about the issue resolution progress.

We are sorry for the inconvenience caused.

Best Regards,

Hi,

Any news on this since 01-13-2016 ?

Hi,


Thanks for your patience.

As we
recently have been able to notice this issue, so issue is pending for review as the team has been busy investigating/fixing other previously reported high priority issues. Nevertheless, as soon as we have made some definite progress towards
its resolution, we would be more than happy to update you with the status of
correction.

Our humble request is
to please be patient and spare us little time.

Hello,



Being responsible for a development team, I understand the urgency of fixing high priority issues :wink:





But if I remember well, since mid-November 2015, the documentation of Aspose is advertising on the possibility to flatten PDF XFA. And since that time, we have several business projects blocked by this issue (PDF XFA are supported neither as archives by our ERMS nor as annexes by our document generation platform).





As this is yet a 6 months old issue, could you give me now some more concrete input on a possible solution. It will help me to decide if we continue on those projects with Aspose or if we buy another product…





Kind Regards.

Hi there,


Thanks for your feedback. Please note your reported issue seems file specific issue instead feature failure at all. However we have recorded your concern and also raised the issue priority in our issue tracking system. We have also requested our product team to complete the investigation of the issue and share an ETA at their earliest. We will keep you updated about the issue resolution progress.

We are sorry for the inconvenience caused.

Best Regards,

Hello Aspose Team



Thank you for your feedback.



Would you be able to explain to us what exactly is wrong in the xfa pdf that we are not able to flatten using Aspose. If we understand the issue better, we could then modify our pdf to remove this and thus enable us to flatten pdfs using Aspose.



Many thanks

Hi there,


Thanks for your feedback. I am afraid we can not suggest you any thing without completion of issue investigation. I have passed on your concern to product team, as soon as they complete the issue investigation we will provide you ETA or any possible workaround.

Thanks for your patience and cooperation.

Best Regards,

Hi,



Anything new regarding this issue ? It’s 11 month old now…





Kind regards,

Hi there,


Thanks for your patience. Please note this document is signed therefore special option SignDependentElementsRenderingModeWhenConverted should be used. Please download latest version of Aspose.Pdf for .NET and use following sample code, it will resolve the issue.

Aspose.Pdf.Document
document = new Aspose.Pdf.Document(“Fiches+Modulis+fabien.pdf”);<o:p></o:p>

document.Form.SignDependentElementsRenderingModeWhenConverted = Aspose.Pdf.Forms.Form.SignDependentElementsRenderingModes.RenderFormAsSigned;

document.Form.Type = Aspose.Pdf.Forms.FormType.Standard;

//document.Flatten();

document.Save("Fiches+Modulis+fabien_standard.pdf");


Best Regards,

Hi,



We tested your code on the file given in a previous message: it’s perfect.



But we have other problems with other files of the same type.





See attachments



Origin.pdf = Original Pdf



Result.pdf = Result after conversion.



Kind regards.

Hi there,


Thanks for your inquiry. I am looking into it and will update you shortly.

Best Regards,

Hi there,


Thanks for your patience. I have noticed following issues in resultant standard Form and logged in our issue tracking system for further investigation and rectification. We will keep you updated about the issue resolution progress within this forum thread.

PDFNET-42103: Text formatting issue.
PDFNET-42104: Third page is lost
PDFNET-42105: Extra form field appearing on first page

We are sorry for the inconvenience.

Best Regards,

Hi, Any news on this since 01-10-2017 ?

Hi there,


Thanks for your inquriy. I am afraid these issues are still not resolved, as these are recently logged and pending for investigation in the queue. We will notify you as soon as we made some significant progress towards issues’ resolution.

We are sorry for the inconvenience.

Best Regards,