I made a syntax highlighter and I want an option to save as a PDF. I've looked at this SO question, but downloading it doesn’t preserve the CSS styling, which ruins the point of downloading the highlighted file. Is there a way I can save my pre
element as a PDF while maintaining the CSS?
HTML:
<pre id='output'> (highlighted portion) </pre>
<button id='save'>Save as PDF</button>
JS:
$('#save').click(function(){
//this is what I need help with
});
As you may have noticed, I'm using jQuery, if that matters.
pre
, not the entire page