CFDUMP isn't always what is seems
Tuesday June 2, 2009 ·
549 views ·
0 comments
While working with <cfpdf> to split mutlipage PDFs I ran into a strange issue. In dumping the resulting variable from an <cfpdf action="read"> call, the output shows the variable being a structure with several properties. The problem is, if you try to access any of these properties using normal access notation (ie. object.property), an exception will be thrown stating that the property doesn't exist. Take the following example: You will notice that the dump shows a struct with the following properties. ![]() Now, try and access one of those properties. For example: You will receive an exception. The way to get around this is to use the 'undocumented' getMetaData() method of the underlying 'coldfusion.pdf.PDFDocWrapper' object. It will return an object which you can then access the properties that you see in the debug. I'm guessing that <cfdump> returns the results of the getMetaData() call on PDFDocWrapper object instead of what the object really represents. </cfdump> Comments
"Only a life lived for others is a life worthwhile." - Albert Einstein ![]() Blogging
Recent ReadsBlog Roll
|




