[Klug-general] printing a web page to PDF

MacGyveR macgyver at thedumbterminal.co.uk
Wed Apr 23 19:57:33 UTC 2014


On 22/04/2014 11:03, Dan Attwood wrote:
> Hi
>
> Does anyone have a good method to put a button on a web page that when 
> clicked it will generate a pdf of all the content in '<div 
> id="content"></div>' and force it to download.
>
> I've tried jsPDF but can't get it to create the PDF without if also 
> stripping all the formatting.
>
> Dan
>
>
> _______________________________________________
> Kent mailing list
> Kent at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/kent
As an alternative, you could just open a new window with the html 
content styled with a print view css then the user can print or download?

If this was server side i'd use HTML -> XSLT + XSL-FO -> PDF
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/kent/attachments/20140423/0938f53a/attachment.html>


More information about the Kent mailing list