Free Support Forum - aspose.com

How to flatten PDF?

I have a multi layered PDF which i want to Flatten it. I used Flatten() function of Document and Document.Form class but it doesnt flaten, Removes all fields from the document and place their values instead.

is there any other function that combines multi layer PDF into single layer

Hi Laxmikant,


Thanks for using our products.

The Flatten(…) method is used to make the form fields present in PDF file un-editable/in-accessible for the user viewing the document so that he/she cannot update the values. It simply removes the form fields and places their values as text string over the PDF file. Concerning to multi-layer PDF file, can you please share some details and sample PDF and also some information regarding the output which you need to generate. We are sorry for your inconvenience.

Should i use Document.Flatten() or Document.Forms.Flatten()


I get error when i use Document.Forms.Flatten() "At most 4 elements (for any collection) can be viewed in evaluation mode."

note that i have applied the license file

I solved the license issue, but i still want to know should i use Document.Flatten() or Document.Forms.Flatten()

Laksh:
Should i use Document.Flatten() or Document.Forms.Flatten()
Hi Laxmikant,

Both methods perform the same operations but I would recommend you to please try using Document.Form.Flatten(); method. In case you encounter any issue, please feel free to contact.

Laksh:
I get error when i use Document.Forms.Flatten() "At most 4 elements (for any collection) can be viewed in evaluation mode."
The reason you got above specified error message is because your license was not initialized. This message appears when using the product in trial/un-licensed mode.

We are sorry for your inconvenience.