At its simplest, you can stick some text between the opening and closing tags of cfdocument there is currently no built-in cfdocument script equivalent and it will render a PDF to the screen. It would be optimal if anything you produce in a browser will look exactly the same in the cfdocument generated PDF. However, cfdocument currently only supports HTML 4. Setting Page Attributes cfdocument has attributes that allow you to set margins, page size, page orientation, and passwords.
|Published (Last):||20 July 2014|
|PDF File Size:||4.3 Mb|
|ePub File Size:||2.75 Mb|
|Price:||Free* [*Free Regsitration Required]|
Reading a PDF The cfpdf tag accepts an action property, which currently has 18 possible values. The thumbnail action also has other arguments that work along with it to determine the scale, max breadth, resolution, and naming scheme for the generated thumbnail. Extracting Images Most images embedded in a PDF can be extracted and saved to a folder of your choice using a file prefix of your choice.
By default, the file prefix is "cfimage-" and the image number. The default destination is in the same folder as the ColdFusion page calling the cfpdf tag. The simplest is to pass a comma delimited list of PDF files, which will append them in the order you list them. The cfpdfparam tag accepts source, pages, and password arguments. The pages attribute can choose what page s you want to merge into the final document.
You can choose one page or a list of page numbers. Password is used for password protected PDFs. The code below will combine two PDFs: mypdf. However, rather than appending it, we will take the first page of mypdf. The order strategy is either by name ascending alphabetical or time ascending by file time stamp.
Specifying a destination is optional for delete actions. If you do not specify a destination, the page or pages will be deleted from the original source PDF. If you specify a destination, a new PDF will be created with the watermark; otherwise the watermark will be added to the source PDF. By default, the watermark is placed in the center of the page.
Rotation is the number of degrees the watermark image will be turned. The position argument takes Cartesian coordinates, with the top-left corner being the 0,0 position. To help slim down the file size and speed up the rendering of a PDF, you can use the optimize action on the cfpdf tag. The result can be saved to a new file, the original source, or a variable.
The above guidelines are very general as both the resultant compression is highly dependent on the actual content of your PDF. Headers and Footers cfpdf also has actions called addHeader and addFooter which will add a header and a footer to an existing PDF.
The header or footer can be simple text or an image. Documentation licensed under CC BY 3. Hosting provided by Hostmedia.
Subscribe to RSS