JavaScript - How to set a PDF's zoom to 100%

In order to set the zoom of a PDF file to 100% please follow the steps below:
  1. Go to XML View 
  2. On the <xfd:document/> tag, add the property xf:annotation-reference='{annotationID}', where '{annotationID}' is the ID of the annotation enclosing the PDF zoom settings;
    In the attached sample, we used '1' as ID value;

  3. Add an <xf:annotation/> element as direct child of <xfd:document/>.
    The element should have the id property set to {annotationID}.
    In the sample, the settings are: <xf:annotation id='1'>..</xf:annotation>.

  4. The JavaScript section which will be used for the PDF output settings should be enclosed in the <xf:annotation/> element defined in the previous step.
    The JavaScript snippet should look like this:
    <xf:javascript output-type='pdf'>
          this.layout = 'SinglePage';
          this.zoom = 100;
    </xf:javascript>

Attached is a sample which was generated after using the steps above.

Have more questions? Submit a request

Comments

Powered by Zendesk