1
votes

In my ColdFusion application, when exporting a PDF, it shows a popup (with title Adobe Reader) with the error message

"cannot extract the embedded font 'PCBOHZ + TimesNewRomanPS-BoldMT. some characters may not display or print correctly ( OR ) cannot extract TimesNewRomanPS-BoldMT"

The same PDF downloads in my local environment, and all other systems, without any issue. This issue occurs only in one of the client system (windows 8).

The <CFDocument> tag is used to create PDF which uses font-family = "Helvetica". This PDF contains cfchart images (contains ColdFusion generated HTML code). All of the html code of this PDF is rendered in the browser as a report dashboard view. On this dashboard, users click on a "PDF" button, and the same HTML content is placed inside the CFdocument body, and raises the alert popup.

Initially I thought it's related to Adobe Acrobat Reader. Later I found that it is not a issue in the PDF creation. It seems like some CSS syntax issue, where I have given wrong font family name. There's no PCBOHZ + TimesNewRomanPS-BoldMT font family name. I need to import that font ttf file in CF admin fonts.cfm file. But my doubt is if this is related to css style, the same HTML should not render in client browser right? Please share your thoughts.

Another Issue is CFDOCUMENT images are missing

In the generated PDF the images are showing as red cross marks, while creating PDF, CFDOCUMENT makes HTTP URL calls to coldfusion server to get the images from the CF virtual folder CFIDE/CFSERVLET (because these images are saved in this folder by cfchart tags based on the charting settings in CF administrator), In google I found the cause for this issue may be At the time of HTTP requests for images, due to ColdFusion is behind a firewall because of which CFPDF is not able to send any HTTP request (even though to itself) . due to this image requsets gets 404 status, so in the downloaded PDF it shows default HTML IMG tag red cross marks .One of the valuable coldfusion topic URL, there's a solution to work http requests by maintaining HOSTS File Entry - can add an entry for the internal IP to your HOSTS file. Please share your thoughts on this issue & suggest me what approach I should follow to resolve this.

popup comes when exporting the pdf

2
Is there a question here?Scott Stroz
what is the chart format?Dan Bracuk
Can you post a small, stand-alone, example that reproduces the issue?Leigh
@ScottStroz I'd say there's not only a question here, but there are two questions here. One about fonts, one about images.Adam Cameron

2 Answers

0
votes

You can try adding FONTEMBED="yes" in cfdocument. This link may further help you. Refer to this post. https://forums.adobe.com/thread/728994?tstart=0

0
votes

For the red X issue, I've found CFPDF/CFDocument to be most reliable with CFChart images if pulling them from a local drive. For instance, write the CFChart image to a local drive (the RAM drive is good for this) and then write the image tag something like:

<img src="file:///ram://myimage.png">

For the fonts, you may be out of luck. I have wasted far too much time with your exact same issue with fonts and ColdFusion PDFs. Why on earth Adobe does not offer an integrate Acrobat option with CF is a complete mystery. In cases where different fonts are a necessity I've resorted to creating PDFs with 'wkhtmltopdf'.