• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Large request - Error occurred while generating PDF. Reason: Error occurred while handling request.

New Here ,
Feb 25, 2021 Feb 25, 2021

Copy link to clipboard

Copied

The following error is generated when trying to use cfhtmltopdf function on the page:

 

Error Occurred While Processing Request
Error occurred while generating PDF.
Reason: Error occurred while handling 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?

Views

154

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 25, 2021 Feb 25, 2021

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 25, 2021 Feb 25, 2021

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>

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 26, 2021 Feb 26, 2021

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation