Expand my Community achievements bar.

flattenPages - again

Avatar

Level 3
I need to enable users to flatten PDF eForms I have created using Adobe Designer 7 - prior to their being eMailed.



I have read a thread here that states that flattenPages will not work on Designer 7 forms due to the automatically applied locking of the PDF by the Designer.



I get following error - "NotAllowedError: Security settings prevent access to this property or method."



How can I enable flattenPages on Designer 7 eForms - or is there a way to remove or limit the Designer Locking to enable this function to run please ?
4 Replies

Avatar

Former Community Member
You can't get around the security settings, and in fact they are in place because if you tried to do things like in Acrobat it would not work at all because the underlying technology is different.



Designer forms can be flattened using LiveCycle server products, but in your case you would probably do better just using a script that sets all fields to read only.



Chris

Adobe Enterprise Developer Support

Avatar

Level 3
Hi Chris



Thanks for the quick response. Unfortunatly we are already Locking all the fields but the customer wants to Flatten the PDFs to reduce form transmission file sizes - the form is 5 pages and is 1Mb as a PDF eForm format file.



Client has LiveCycle Forms Server - could we put a Button on the form that would 'render' as flat PDF through Form Sever then automatically eMail the resulting 'flat' PDF to named eMail address ?



Stuart

Avatar

Former Community Member
Ok, if you have LiveCycle Forms at your disposal then that is great. You can flatten the form by having a submit button on the form that submits via HTTP to a server side component (ie: servlet) that uses the Forms API to flatten it (use renderForm() with the "PDF" transformation). You may actually want to take the data submitted and merge into another similar template that doesn't have extra objects that you wouldn't want on a flat PDF (ie: buttons).



At that point you could send the flattened PDF back to the client machine (or not if you don't want to). You couldn't send it back to the client and have it automatically send the email from the client because a flattened PDF is basically just a piece of paper on the screen and you can't run any scripts on it to give it any intelligence.



So, what you could do, is submit to the server, use Forms to create a flattened PDF, and then email that from the server (if your using Java you could use the JavaMail API to accomplish that). Or if the email must be sent from the client, and the PDF must be flattened, the only way I could see that happened would be the manual workflow and rendering the flattened PDF back to the client and then having them save the PDF and send an email with it attached.



Hope that helps.



Chris

Adobe Enterprise Developer Support

Avatar

Level 3
Hi Chris



Brilliant - at least that gives us a way round the Designer PDF eForms 'locking' problem.



Thanks for your speedy and knowlegable, assistance :o)



Best Regards - Stuart