These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Javascript and Print Control

pb
Registered: Jan 23 2009
Posts: 27

Hi,

I have a pdf file form (contract) with Javascript coding. I would like to make sure that the form (contract) can only be printed on an 8 1/2 x 11 or legal size 8 1/2 x 14 paper. Is there any way to do this? In other words I don't want the form to print unless it is being printed on the correct size of paper. Does anyone know how to do this? Thank you for any help you may be able to offer.
Regards,
Paul

My Product Information:
Acrobat Pro 7.0
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

I don't think so.
You only can define if the form is printable or not in the security settings.

To be sure that the form is printed always completely on every paper format, you can use the bShrinkToFit parameter for a print button.

Example:
this.print({
bUI: false,
bSilent: true,
bShrinkToFit: true, //Fit to Papersize
nStart: 1,
nEnd: 1
});

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

pb
Registered: Jan 23 2009
Posts: 27
Thank you very much for your reply and for the code sample. I was trying to avoid having a print button but this may be the only way to do it. Thank you for providing the code. I am relatively new to Javascript coding so can I ask you: Would this code be on a button? On what action or where? Thank you for your help and advice.
Regards,
Paul
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You should have a look into the JS Developer Guide.

http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf

There the sample I posted is from.
Look chapter 5 for printing PDF's for more information.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

pb
Registered: Jan 23 2009
Posts: 27
Hi
Thank you very much for the reference. I will do as you suggested.
Regards,
Paul