Skip to main content
Participant
October 11, 2010
Question

CFPRINT outputs empty page or garbled content

  • October 11, 2010
  • 2 replies
  • 1359 views

Hi all,

okay I have to explain our situation first:

We have CF9 on a Windows Server 2003 machine. Fully patched with all latest stuff.

On CF Admin I can see our printer attached to the server. The CF9 server runs under a specified user who has full access to the system and the printer.

We create a PDF document on the server by populating a PDF Form that was made with Adobe Acrobat 9 Pro (Live Cycle Designer).

If we want to print the populated form with cfprint programmatically (the PDF output can be viewed or printed with Acrobat Reader 9.3 without problems), the printout is either a completely blank page (printer attached to server) or a garbled page with missing letters or letters replace with squares (on an other printer on a duplicate setup: Quality Management System CF9 as well).

We did use CFPDFFORM populating an existing empty PDF Form because the form layout changes often and we didn't want to use CFDOCUMENT to create the PDF because we not wanted to rewrite the cfdocument PDF generating part everytime the PDF layout would change.

Someone has a hint what is going wrong here?

Thanks for all possible help

    This topic has been closed for replies.

    2 replies

    Participating Frequently
    August 30, 2011

    More or less a related issue with images.  Not sure if anyone following this thread can help.

    I've been able to embed an image in my pdf form and actually display the image in the resulting pdf form.

    Code is quite stright forward:

    <cfpdfform action="populate" source="BdTv5.pdf" xmldata="#bonData#" destination="#expandPath('/grr.pdf')#" overwrite="yes" />

    the xml data contains image data inserted in the xml using the toBase64() function.

    As mentioined above, the dynamic result file 'grr.pdf' outputs the image correctly, ea. I see the image previously stored in the xml.

    Once I flatten the pdf form to a static pdf file, the image is gone while the text data from the xml is still there and converted to 'static' text.

    Code used to convert the pdf form to static Acrobat file:

    <cfpdf action="write" flatten="yes" source="#expandPath('/grr.pdf')#" destination="#expandPath('/grrStatic.pdf')#" overwrite="yes" />

    I hope I'm wrong and that I'm doing something wrong, but I suspect Adobe is blocking on purpose the ablility to flatten dynamicly inserted images in ColdFusion to sell more LiveCycle / InDesign stuff while ColdFusion could do an excellent job at a fraction of the investment.

    Participant
    October 15, 2010

    Hello all,

    I solved the problem myself:

    The printjob seems not to have the used fonts embedded when you generate it with CFPRINT!? I checked the fonts installed on the according printers and found that on one printer where the page was blank ,Myriad Pro' was not installed on the printer (IT IS on the SERVER!). When I changed the fonts everythingw as printed except the populated form fields!

    So I had a new problem.

    By flattening the created PDF before printing with CFDOCUMENT action='write' flatten='yes' I saved the PDF with a different name and CFPRINTed the new PDF, voila no more missing form fields or characters...

    So hopefully this information can help someone else in the future.

    regards

    Gilbert

    Participating Frequently
    October 26, 2010

    Thanks Gilbert !

    We had the exact same problem here, problem solved by flattening the pdf form.

    PS. exact syntax for flattening a pdf form as found on the cfPDF doc

    <cfpdf action="write" flatten="yes" source="taxForms\f1040.pdf" 
      destination="taxforms/flatForm.pdf" overwrite="yes">