Skip to main content
Participating Frequently
December 12, 2016
Question

cfcontent no longer works with ActivePDF in CF2016 [dealbreaker]

  • December 12, 2016
  • 1 reply
  • 1782 views

I have been evaluating CF 2016 before purchasing to upgrade our server.

One of the key interactions we have always had was between CF and ActivePDF Toolkit.

I have spoken with ActivePDF support, and they have recreated the same issue I am reporting here with CF 2016.

After using the ActivePDF Toolkit function "Get_OutputByteStream" to put the manipulated PDF into a binary data variable (variable name "pdf"), I then pass that variable into CFCONTENT to display it in the user's browser.

<cfcontent type="application/pdf" variable="#pdf#">

However, the result is now a CF error page which says:

"[S is not a supported variable type. The variable is expected to contain binary data."

It has been verified that Get_OutputByteStream in ActivePDF is creating a good PDF by writing the variable named "pdf" to a pdf file on the server.

As a side note, I also noticed and verified with ActivePDF that CF 2016 cannot seem to handle COM properly, so I have to used the .NET integration in working with ActivePDF Toolkit. That is not a big deal but worth mentioning. However, no workaround can be found for the CFCONTENT issue mentioned above.

We have always used CFOBJECT to create the Toolkit object using the following code, which no longer works.

<CFOBJECT ACTION="Create"

    TYPE="COM"

    Class = APToolkit.Object

    NAME="TK">

This topic has been closed for replies.

1 reply

BKBK
Community Expert
Community Expert
December 13, 2016

<cfcontent type="application/pdf" variable="#pdf#">

However, the result is now a CF error page which says:

"[S is not a supported variable type. The variable is expected to contain binary data."

Try

<cfcontent type="application/pdf" variable="#toBinary(pdf)#">

mahancmAuthor
Participating Frequently
December 13, 2016

The "pdf" variable is already converted into Binary Data by ActivePDF by the time it gets to cfcontent, so using toBinary only has CF trying to make binary data of binary data. The result (abbreviated):

The parameter 1 of function ToBinary, which is now %PDF-1.5 %âãÏÓ 3 0 obj << /Type /ExtGState /CA 0.5 /ca 0.5>> endobj 301 0 obj << /Type /Catalog /Pages 30 0 R /Metadata 6 0 R /StructTreeRoot 31 0 R /MarkInfo 5 0 R >> endobj 302 0 obj << /Type /ObjStm /Length 2855 /First 1747 /N 200 /Filter /FlateDecode >> stream xœíšQo�¹r…ÿÊyL�"Ö©"‹$ ��}×»�V6#)@�

To demonstrate the variable is already binary data, if I just flat out dump the PDF variable on the page with <cfoutput>#pdf#</cfoutput> it will show this (abbreviated):

%PDF-1.5 %âãÏÓ 3 0 obj << /Type /ExtGState /CA 0.5 /ca 0.5>> endobj 301 0 obj << /Type /Catalog /Pages 30 0 R /Metadata 6 0 R /StructTreeRoot 31 0 R /MarkInfo 5 0 R >> endobj 302 0 obj << /Type /ObjStm /Length 2854 /First 1747 /N 200 /Filter /FlateDecode >> stream xœíšAo 9’…ÿÊ;Î VŒ A I@

WolfShade
Legend
December 13, 2016

Just curious.  What does ActivePDF do that CF can't natively do when it comes to PDF creation/manipulation?  It seems, to me, to be an unnecessary third-party library, unless it has features that CF PDF capabilities don't.  I'm not entirely familiar with CFPDF or other CF processes for creating/changing/accessing PDF documents, so I'm asking to better understand why ActivePDF is so critical to your project.

V/r,

^_^