We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Save XFA/PDF document into flatened PDF

I am checking the functions of ASPOSE to convert the xfa/pdf document into flattened PDF. Test this function using our existing 8.7 version and the latest demo. Both got exceptions to convert.

Could you please help to test and let us know if anything can fix the issue?

Our sample file is over the size that allowed to upload here. Could you please let us know if we can email or FTP to you?

Thanks!

@jinyang84

Thanks for contacting support.

You may please upload your sample PDF document to some public file sharer e.g DropBox, Google Drive, etc. and share the link here. We will test the scenario in our environment and address it accordingly.

@jinyang84

Thanks for sharing sample PDF document.

I have tested the scenario by flattening the shared document with following code snippet, while using Aspose.Pdf for .NET 17.9 and was unable to observe any exception/error while execution.

Aspose.Pdf.Document doc = new Aspose.Pdf.Document(dataDir + "mortgage_en_re_09-06-2017.pdf");
var fields = doc.Form.Fields;
foreach (var f in fields)
{
 f.Flatten();
}

doc.Save(dataDir + @"mortgage_en_re_09-06-2017_flattened.pdf");

doc = new Aspose.Pdf.Document(dataDir + "mortgage_en_re_09-06-2017.pdf");
doc.Flatten();

doc.Save(dataDir + @"mortgage_en_re_09-06-2017_flattened2.pdf"); 

You may please check in the shared code snippet, that I have used two different ways to flatten the document and both ways generated output without throwing any exception. For your reference, I have uploaded the output document to the same location, where source document is.

However, would you please share a sample code snippet, along with your environment details, so that we can test the scenario again in our environment and address it accordingly.

Thanks Asad! Your sample code helped us a lot! It does flatten my sample file into standard PDF. The only problem is the “Print” buttons are still presented from the flattened result. Is there anyway to get rid of that “Print” button using your API?

The other question is, your code is working when using the latest API ASPOSE.PDF v17. However, we only have the ASPOSE.PDF version 8.7 in most of our environment. Will this flattening function still work with that version?

Thanks!

Jin

@jinyang84

Thanks for your feedback.

We have observed the same issue at our end while using Aspose.Pdf for .NET 17.9 and have logged an investigation ticket in our issue tracking system, against the issue. We will further look into the details and as soon as we have some feedback from our product team, we will let you know. Please be patient and spare us little time.

Please note that it is always recommended to use latest version of the API because it contains more fixes and enhancements. I am afraid that you are using a quite old version of the API and we strongly recommend you to upgrade to latest version. However, in case you face any issue while using latest version of the API, please feel free to contact us.

We are sorry for the inconvenience.

Hi Asad,
Before we decided to upgrade to the latest version, we have double checked the flattened result file based on your code snippet. And we released that the result was not actually successfully flattened since the “Unlock Form and Remove Signature Page” button is still there and I can still click it to make the form editable as the regular XFA pdf. The “flattened” result documents as you posted on the our file drop folder are still the XFA format: https://filedrop.fct.ca/file

Could you please let us know if there has any fix from ASPOSE for this issue?

Thanks very much!

@jinyang84

Thanks for writing back.

We have also observed the same issue in the generated output document(s) and for the sake of correction, we have logged this issue in our issue tracking system, under the ticket ID PDFNET-43417. Our product team will definitely look into the details of the issue as per their development schedule and as soon as we have some definite updates, regarding resolution progress of your issue, we will inform you within this forum thread. Please be patient and spare us little time.

We are sorry for this inconvenience.

Hi,
Just want to follow up if there has any update for this XFA pdf flatten issue from your API? We are proposing the solution of this function right now. Your fix will directly impact our solution decision. Could you please let us your status asap?

Thanks!

Jin

@jinyang84

Thanks for contacting support.

I am afraid that earlier logged issue is not resolved yet. However we have recorded your concerns and shared them with respective team. As soon as we have some certain updates regarding resolution progress of your issue, we will let you know. Please be patient and spare us little time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-43417) have been fixed in Aspose.PDF for .NET 18.6. This message was posted using BugNotificationTool from Downloads module by asad.ali