Working with PDFs (Part 2) · Raymond Camden. Yesterday I blogged about new PDF functions added in Cold. Fusion 8: is. PDFFile and is. PDFObject. Today I’m going to continue my discussion of the new PDF tools in Cold. Fusion 8 by introducing the CFPDF tag. This is one of the 5 new PDF related tags added to Cold. ColdFusion Development, Life, and Other Stuff: CF8 PDF Manipulation: Pulling Text Out. Hello, I keep getting a failure status on the cfdump. I copied and pasted your code and renamed your rptLauncher2.pdf file to a pdf file of my own. ColdFusion has had the ability to work with PDF forms for a while, but I never got a chance to actually play with it till last night. A client needed me to build a simple POC that used an HTML form to accept user input. This user needed the input to be passed to the. View Help PDF ( 32MB) Home / ColdFusion 9 CFML Reference / ColdFusion Functions / Functions t-z XmlParse Description Converts XML text into an XML document object. Returns. Fusion 8. This one tag can do many things: It can add or remove a watermark to a PDF. It can remove pages from a PDF. Ever wanted to remove the legal crap from in front of a PDF? Or an ad?). It can return information about a PDF. It can merge multiple PDFs into one. It can add/remove security from a PDF. It can read a PDF.
Duh.). It can set metadata to a PDF. It can create thumbnails from a PDF. It can write out to a PDF. Lets start off with a simple example of reading a PDF. Consider the following example. PDFFile(“book. pdf”)> & lt; cfpdf action="read" source="book. I begin by checking to see if a file is a proper PDF. If it is, I then use the CFPDF tag to read the PDF into a variable named mypdf. At that point I can dump the PDF and see information about it. By the way, the same trick (reading and dumping) works for images as well. I’ve displayed the dump to the left, and you can see it reveals quite a bit of information about my PDF. The PDF I had used was one made from scratch using CFDOCUMENT, so somethings like Author and Keywoard are blank. But it did pick up the page size and security settings. It is too bad that CFDOCUMENT doesn’t easily allow us to set the metadata, but guess what? We can use the CFPDF tag to correct that! The set. Info command lets you pass in a struct of information. You can change the author, the subject, the title, and the keywords for a PDF. Let’s look at a simple example. PDFFile(“book. pdf”)> & lt; cfset data = {author="Raymond Camden", Subject="Paris Hilton", Title="The Wit and Wison of Paris Hilton", Key. Words="paris hilton,wisdom,wit"}& gt. I first create a simple struct of data. I then pass this struct to the CFPDF tag, noting the action of setinfo, the source for my PDF, and the struct of data. I then use get. Info to get the information back, and dump it. Now my PDF created from CFDOCUMENT has proper metadata in it. Tomorrow I’ll demonstrate adding and removing watermarks from your PDF documents.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
October 2016
Categories |