Copy link to clipboard
Copied
I get an error generating my PDF whenever someone's name has a special character's in their name such as accents and diacritics.
Is this a bug or how do I properly set the charset for the <cfhtmltopdf> tag. I didn't have this issue with Coldfusion 9 and cfdocument. Any help in this regard would be much appreciated.
version: Coldfusion 11 Update 3 on Windows Server 2008 R2 on IIS 7.5
SEE STACK TRACE BELOW
coldfusion.document.webkit.PDFgErrorHandler$ServiceManagerConversionException: Error occurred while generating PDF. at coldfusion.document.webkit.PDFgErrorHandler.handleConversionError(PDFgErrorHandler.java:188) at coldfusion.document.webkit.HttpPDFRequestHandler.requestPDFGeneration(HttpPDFRequestHandler.java:113) at coldfusion.tagext.lang.HtmlToPdfTag.processPDFgRequest(HtmlToPdfTag.java:1331) at coldfusion.tagext.lang.HtmlToPdfTag.handlePDFgConversionRequest(HtmlToPdfTag.java:1466) at coldfusion.tagext.lang.HtmlToPdfTag.convertToPDF(HtmlToPdfTag.java:1413) at coldfusion.tagext.lang.HtmlToPdfTag.doEndTag(HtmlToPdfTag.java:1551) at cfcfhtmltopdf_createPDF2ecfm2090701148.runPage(c:\inetpub\wwwroot\myapp.com\includes\docs\cfhtmltopdf_createPDF.cfm:25) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:246) at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:736) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:572) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2986) at cfmethods2ecfm1148258034$funcSAVEPROXY.runFunction(c:\inetpub\wwwroot\myapp.com\cfc\docs\methods.cfm:472) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:648) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:457) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2424) at cfmethods2ecfm1658643382$funcPROCESSSTEP.runFunction(c:\inetpub\wwwroot\myapp.com\cfc\memberResults\methods.cfm:377) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:648) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:457) at coldfusion.filter.ComponentFilter.invoke(ComponentFilter.java:251) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:480) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:42) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:142) at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.xml.rpc.CFCServlet.invoke(CFCServlet.java:156) at coldfusion.xml.rpc.CFCServlet.doPost(CFCServlet.java:348) at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:199) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)
Copy link to clipboard
Copied
Does anyone have any suggestions?
I've tried:
Does the <cfprocessingdirective pageencoding="utf-8"> just have to be within the CFC method or does it need to be within the <cfhtmltopdf> tag?
Any input or things to try would be much appreciated as this is a regression for our app.
**As a side note: I would still just use CFDOCUMENT, but there was a different issue where the images were outputting a RED X where the image is supposed to be. Which from what I have been able to uncover has something to do with the server certificate not being trusted or something. However, our SSL provider is listed in the ROOT Certificate Authorities so not sure what's going on with that. Those images were being output with cfimage action of writeToBrowser .
I'd really like to fix the encoding issue does this have anything to do with language packs or missing languages of that sort? My app displays the page just fine when the UTF-8 charset meta tag is set.
Copy link to clipboard
Copied
Could you show us the code or a sketch of the relevant part? The following test code, which I lifted straight out of the official cfhtmltopdf documentation, works as expected.
<cfhtmltopdf
name="façade"
destination="usage_example.pdf" overwrite="yes"
source="http://www.google.com/"
unit="in" pageheight="8" pagewidth="4"
pagetype="custom" />
done.
I, too, am on ColdFusion 11 Update 3.
Copy link to clipboard
Copied
I realize I'm late to the party here, but in case anyone else finds this, I have found that this error ("Error occurred while generating PDF") happens when you simply don't have the "add-on service" running. The OP was using CF11, so they'd want to look at the ColdFusion 11 Add-On Service (in Windows or Linux) to make sure it's running.
Also, one could go into the CF Admin, to the "PDF Service" page, and click the "check" icon to the left of the listed PDF service (the default one runs on 127.0.0.1 at port 8989). If you don't get an "ok" status (in the rightmost column) when using that "verify" button, then that also tells you the service is not running.
For most, that will be enough to get on with things. They just didn't realize they had failed to start the service. For others, there could be all kinds of reasons it won't start, cant' be connected to, may not exist, and so on. This really isn't the place to get into all those possibilities (or to answer all questions that would rise about them). Each would really deserve its own new forum question.
I will point out that I can help with all such problems by way of remote online consulting, if interested, at carehart.org/consulting. (I don't mention that often in my answers, but in this case it seems that would probably be the most expedient way to get a solution to any such problem as those above.)