This is an archived forum post. The information may be outdated. Contact us if you have any questions.

include print button in HTML converted to PDF

Daniel_2112 wrote on 2015-11-02:
Hi guys,

I have an HTML file that I have converted to a PDF via the API. I have a <button> element that tells the browser to print the page. The code is below. It works with the HTML but does not work once the HTML is converted to a PDF.

<input type='button' id='hideme' onClick='window.print();' value='here'>

HTML: http://staging.golfvinegolflessons.co.uk/vouchers/golfvinevoucher2/index.html (WORKS)
Converted PDF: http://staging.golfvinegolflessons.co.uk/vouchers/golfvinevoucher_4640.pdf (DOESN'T WORK)

Is there some sort of other PDF specific code I need to include instead of the button I've included? Or pehraps have it as an actual piece of JS rather than in the buttons inClick="".

Please respond asap, thanks guys.

Daniel.
Daniel_2112 wrote on 2015-11-02:
I've had to make some amends to the voucher/index.html file as its a staging/live version.

And so I've had to remove the <input type='button' id='hideme' onClick='window.print();' value='here'>.

Sorry.
support wrote on 2015-11-03:
Hello Daniel,

A button (or a link) that triggers a Javascript action will not work in PDF, our software does not support this.