How do I flatten a XFA form into a PDF non form

We’re using your Aspose.Pdf.Facades.Form FlattenAllFields method to flatten our XFA forms. It works well but the output file still seen as a form even though there are no fillable fields. When I look at the document metadata the form property shows as XFA. Is it possible to save in a format where the form property equals “none”. aka a non-form pdf.

The issue discussed in the link below appears to be similar but the solution isn’t really discussed.
(PDF flattening - Flatten() method is making all fields non-editable but Buttons all are there in PDF - Cannot save as regular PDF)

@catpus

One of the workarounds can be to convert the PDF pages into images and then create new PDF document with those images. However, can you please share your sample PDF for our reference along with the screenshot of form property with which you are concerned? We will investigate your requirements and share our feedback with you.

I was worried that I might have to do that.

The requested screenshot of the metadata for the DS0240B.out.pdf is attached, as well as the original and output documents.

DS0240B.pdf (185.1 KB)
DS0240B.out.pdf (4.7 MB)
image.png (33.3 KB)

@catpus

Can you please check the attached PDF whether it contains form property or not and share the screenshot with us. It was generated through 23.4 version of the API.

I don’t see an attachment in the forum or in the email you sent me.

ADS0240B_Filled.flattened.pdf (166.9 KB)

@catpus

Please find the attachment above.

There are two issues with the file. First, the PDF content is lost and replaced with a “Please wait…” message.

The file also still contains the Form: XFA meta data. I also noticed the Aspose.PDF version is 23.3. See the ADS0240B png attachments.

I also did some testing with conversion of XFA to document formats, but all tests failed with a message similar to the one in your PDF.

I tried the same tests after converting the XFA format to Acroform. I had better results, but data in the form fields was lost when when converting to Word or image formats. See the output zip file.
DS02408_metadata.png (28.5 KB)
DS0240B.9.pdf (999.1 KB)

Output (2).zip (88.1 KB)

Added missing ADS screenshots.
image.png (32.0 KB)
image.png (30.6 KB)

@catpus

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-54570

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Do you have a rough estimate on when this will be actioned?

@catpus

The ticket has recently been logged in our issue management system and it will be investigated and resolved on a first come first serve basis. We will surely inform you as soon as it is investigated and we have some updates about its fix ETA. Please be patient and spare us some time.

We are sorry for the inconvenience.

Any updates?

@catpus

We are afraid that no updates are available at the moment about the ticket resolution. Nevertheless, we will inform you via this forum thread as soon as we have definite updates about ticket fix or resolution ETA. Please spare us some time.

We apologize for the inconvenience.

Is it possible to save the Form to a different format? I’ve tried to convert to DOCX but it fails with the "Please wait… If this message is not eventually replaced by the proper contents of the document, your PDF… " message. It’s possible I’m just doing it wrong? I am using your example in PDFNET-43441

@catpus

Are you trying with the same document that you shared with us already? Can you please share that example here for our reference along with the sample document (if you are using a different PDF)? We will further proceed to assist you accordingly.