tracker issue : CF-4203132

select a category, or use search below
(searches all categories and all time range)
Title:

[cielen] cfhtmltopdfitem - error when used with special characters

| View in Tracker

Status/Resolution/Reason: To Track//HaveNewInfo

Reporter/Name(from Bugbase): Philipp Cielen / ()

Created: 07/24/2018

Components: Document Management, PDF Generation (CFHTML2PDF)

Versions: 13.0

Failure Type: Crash

Found In Build/Fixed In Build: CF 2018 /

Priority/Frequency: Normal / All users will encounter

Locale/System: German / Windows 10 64 bit

Vote Count: 0

This one was quite tricky to break down and isolate. cfhtmltopdfitem seems to throw an error as soon as more than three special characters are used anywhere in the code - even in comments!

Try this code:
 
<cfhtmltopdf>
<cfhtmltopdfitem type="header" >
	<cfoutput>
		ü
	</cfoutput>
</cfhtmltopdfitem>
<html><head><body><cfoutput>test ä</cfoutput></body></head></html>
<!--- öä --->
</cfhtmltopdf>

it will throw an error "Error in handling header footer related attributes."

As soon as at least one of the four German special characters (öäü) on the page is removed, the error will no longer occur. 

Found in the release version of CF 2018

Attachments:

Comments:

add -Dfile.encoding=UTF8 in jvm arguments using cf administrator's server settings
Comment by Ajay Kumar Rai
29448 | August 03, 2018 05:57:00 AM GMT
Hi Philip, Can you try adding the encoding -Dfile.encoding=UTF8 in jvm arguments in jvm.config file?
Comment by Kailash Bihani
29449 | August 09, 2018 10:19:07 AM GMT
Default Encoder "ISO-8859-1" is inconsistent with generating byte streams for these gereman characters because they not supported by encoding ISO-8859-1. Thus when acrobat content reader is not getting correct stream of bytes it is throwing exceptions. These characters are supported by utf-8 encoding and to use utf-8 encoding add "-Dfile.encoding=UTF8" in jvm arguments using cf administrator's server settings, same has been demonstrated in image below. !CF-4203132.JPG|thumbnail!
Comment by Ajay Kumar Rai
29450 | August 09, 2018 10:21:47 AM GMT
Default Encoder "ISO-8859-1" is inconsistent with generating byte streams for these gereman characters because they not supported by encoding ISO-8859-1. Thus when acrobat content reader is not getting correct stream of bytes it is throwing exceptions. These characters are supported by utf-8 encoding and to use utf-8 encoding add "-Dfile.encoding=UTF8" in jvm arguments using cf administrator's server settings, same has been demonstrated in image below. !image-2018-08-09-16-11-38-277.png!
Comment by Kailash Bihani
29451 | August 09, 2018 10:41:41 AM GMT