Transmit of custom data

56 views
Skip to first unread message

jke.s...@googlemail.com

unread,
Sep 26, 2014, 4:57:20 AM9/26/14
to pdfnet-w...@googlegroups.com

Hi,

we have some trouble with the transmission of custom data via "custom:" and window.ControlUtils.getCustomData().

We transmit language names amongst others in different languages. These data contains special characters like the german 'ö', 'ä' etc.
These characters will be changed in some kind of control characters within some functions of pdftron. (Probably decodeURIComponent in CoreControls.js which is minimized?)

How can we avoid this unwanted translation?

Kind regards,
Jens 

Matt Parizeau

unread,
Sep 26, 2014, 6:05:08 PM9/26/14
to pdfnet-w...@googlegroups.com
Hi Jens,

You're right it looks like there's an issue with this. The issue seems to be occurring because WebViewer is using the "unescape" function when parsing query parameters and instead should be using the decodeURIComponent function.

You can fix it by making two small modifications to ControlUtils.js. In the getString function replace unescape with decodeURIComponent. Then in the getCustomData function change return decodeURIComponent(customData); with just return customData;

Matt Parizeau
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages