HTML to PDF json malformed error

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:

  1. Add a escape character before the double-quotes or \".
{
  "html": "<img src=\"https://url\" />"
}
  1. 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 &quot;.

Incorrect

{
  "html": "This is a "Test"."
}

Correct

{
  "html": "This is a &quot;Test&quot;."
}
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.