HTML to PDF footerHtml and headerHtml don't work via REST API



I’m testing the REST API for a production app, but it seems that the headerHtml and footerHtml are ignored?

I’m sending the below test body to this endpoint:

  "html": "<!doctype html><html><head> <meta charset='utf-8'> <title>HTML to PDF example</title></head><body><header><p>headertext in normal html</p></header> <div> Text in box1 </div><div> Text in box2 </div><footer><div> Text in Footer </div></footer></body></html>",
  "headerHtml": "<!doctype html><html><body><header><p>Real header here doesn't work</p></header></body></html>",
  "footerHtml": "<!doctype html><html><footer><div>Real footer here doesn't work</div></footer></html>",
  "size": "A4",
  "orientation": "Portrait",
  "margins": "5"

All content in the html property of the request is rendered in the PDF successfully, but again, all content in the headerHtml and footerHtml is ignored. Is it a bug in the API or am I sending wrong content?

I have also tried with: <footer><div>Real footer here doesn't work</div></footer>



Hello @Jeppe,

The right format for header/footer is:

<!DOCTYPE html>
This is header

Best regards,
Petr Bushuev
Plumsail Team