Copy link to clipboard
Copied
The following error is generated when trying to use cfhtmltopdf function on the page:
Error Occurred While Processing Request | ||
|
- the page gets successfully generated if the <cfhtmltopdf> tags are removed
- the request generated a lot of data, which is roughly 1200 A4 pages
Is there a limit on the file size/number of pages when using the <cfhtmltopdf> tag?
Copy link to clipboard
Copied
Wow, that's a lot of pages! I don't know if there's a strict file size limit, but you may simply be exceeding the available memory you need. I suggest trying a smaller number of pages per request, then merging them together after you've got them all.
Dave Watts, Eidolon LLC
Copy link to clipboard
Copied
There might be something else bothering your application.
I did some tests to generate a 1400-page PDF. The execution times were as follows:
119 seconds
<cfdocument format="PDF" filename="C:\Users\BKBK\Desktop\largeDoc.pdf">
<cfset i=1>
<cfloop condition="i lte 1400">
<cfset i=i+1>
<cfdocumentitem type = "footer"> Footer text <cfoutput>#cfdocument.currentpagenumber#</cfoutput></cfdocumentitem>
<cfdocumentitem type = "pagebreak" />
</cfloop>
</cfdocument>
12 seconds
<cfhtmltopdf destination="C:\Users\BKBK\Desktop\largeDoc.pdf" overwrite="true">
<cfset i=1>
<cfloop condition="i lte 1400">
<cfset i=i+1>
<cfhtmltopdfitem type="header">Page: _PAGENUMBER of _LASTPAGENUMBER</cfhtmltopdfitem>
<cfhtmltopdfitem type = "footer"> Footer text _PAGENUMBER</cfhtmltopdfitem>
<cfhtmltopdfitem type = "pagebreak" />
</cfloop>
</cfhtmltopdf>
Copy link to clipboard
Copied
Thank you for the replies. I will try to change the way that the pdf is produced by adding the destination parameter and see if that works.