This is called URL encoding and serves to avoid conflict between the contents URL with control characters. For example, URL parsers use the bar, /
, to delimit the segments of the path, as well as using the question mark, ?
, to start the query string and the keel, #
, to start the fragment. If its contents have these characters the URL syntax may be impaired and thus misinterpreted.
For example, if I want to send the logical expression a & b = c
through the URL and make:
https://localhost/query?s=a&b=c
To query string will be interpreted as s=a
and b=c
, which has no relation to our intention. Therefore it should be coded:
https://localhost/query?s=%3Fs%3Da%26b%3Dc
And in this way there will be no redundancy and therefore the URL will be interpreted correctly.
So if the print is being affected by the encoding, you need to review what you’re doing. Its trivial options would be: 1) Correctly decode the URL before using to generate the PDF; 2) Send the content through the HTTP request body and not the URL.
I would recommend the second option.