HTML to PDF json malformed error
When you have double-quotes (")
in your raw HTML code, it could break the input JSON request. There are two ways to fix this issue:
Add a escape character before the double-quotes or
\"
.
{ "html": "<img src=\"https://url\" />" }
Replace double quotes with a single quote or
'
instead of"
.
{ "html": "<img src='https://url' />" }
If you have double-quotes inside double-quotes, we recommend using "
.
Incorrect
{ "html": "This is a "Test"." }
Correct
{ "html": "This is a "Test"." }