The plugin has a unique method for embedding PDF files, using Javascript only, and not iframes or third-party services. Additionally, the pdf embedder will automatically resize whenever the browser dimensions change. Our PDF Embedder plugin is fully responsive, so the embedded PDF will also look perfect, on any device. You can also specify a width and the correct height will be calculated automatically. It works as simple as adding images! Your PDF files will be automatically sized to their natural size and shape. This.addField("MyPrint", "button", this.Upload PDF files and embed them directly into your site’s posts and pages. Button is anchored on the top right corner var rFld = this.getPageBox("Crop",this.pageNum)
The following code uses the Doc.getPageBox() function to place a custom print button in the upper right corner of a page. It has both start and stop page number arguments for setting a range of pages at the same time.Īcrobat JavaScript can be used to automatically add a set of fields to a PDF, but to place the fields correctly it is important to know the locations of the page edges. The second thing to note is the Doc.setPageBoxes() function uses two page number parameters. Not to worry, Acrobat readjusts all coordinate values based on the Crop Box so if you re-acquire the Crop Box its value will be: First, it was stated previously the Crop Box is always at (0, 0), but in this code we are changing the value of the bottom left corner. There are a couple things to notice here. tPageBoxes("Crop",this.pageNum,this.pageNum,rCrop) var rCrop = this.getPageBox("Crop",this.pageNum) For example, the following code decreases the size of the current page by. This function is useful for automating placement of the Art, Trim, Bleed, and Media boxes for printing and resizing the page on the screen, with the Crop Box. There is also a function for setting the page box, Doc.setPageBoxes(). To acquire any of the other bounding boxes just substitute the word “Crop” in the code above with Art, Bleed, Trim, Media, or BBox. The Crop Box has the special property of being the reference for a page’s coordinate system so it’s bottom left corner is always at the coordinates (0, 0).
The rCrop for an 8.5 x 11 inch page would be: The values are in points and there are 72 points/inch. The return value is an array of four numbers representing the edges of a rectangle in the order Left, Top, Right, Bottom. To get the Crop Box for the current document page use the following code (see PageSizeExample.pdf): var rCrop = this.getPageBox("Crop",this.pageNum) It is the bounding box the user sees on the screen so it is also the bounding box used to position visible elements like form fields, annotations, and watermarks. The Crop Box is the most useful for scripting purposes. The BBox is automatically calculated from the actual content on the page, so it is a read only property.
Prerequisites: Familiarity with Acrobat Professional
By Thom Parker, Software Developer/Adventurer, WindJack Solutions, Inc.