Internet Explorer VS Acrobat ActiveX Controls
ColdFusion
At the company I work for, we have a few apps that serve up PDF documents directly from a BLOB (binary large object) stored in the database. "Luckily" for me, IE recently made changes to disable ActiveX controls in the browser. Obviously, that change broke stuff in my apps.
(Have I ever mentioned how much I love IE?
)
The code that performed these functions was written way before I was hired on, and was actually an .asp file that did the querying for the binary object and embedding the PDF.
The tasks I layed out to repair this issue:
The real meat of the solution comes from just a few simple lines of code that take the binary object and make it writeable as PDF.
(Have I ever mentioned how much I love IE?
) The code that performed these functions was written way before I was hired on, and was actually an .asp file that did the querying for the binary object and embedding the PDF.
The tasks I layed out to repair this issue:
- Create a 100% ColdFusion solution (ColdFusion is the goodness)
- Make it work in IE
The real meat of the solution comes from just a few simple lines of code that take the binary object and make it writeable as PDF.
(Please forgive the line breaks)
<!---convert the binary object to a string with base64 encoding--->
<cfset theDocument = toString(tobase64(BinaryDataVariable)) />
<!---write the file to the server temporarily--->
<cffile action="write" output="#binaryDecode(theDocument,"base64")#" file="C:\SomePlaceOnTheServer\filename.pdf">
<!---serve it to IE no problems --->
<cfcontent type="application/pdf" file="C:\SomePlaceOnTheServer\filename.pdf" deletefile="true">





Loading....