1

Is there any way convert an HTML page to a PDF document using javascript only?

I know this can be done using PHP or Java etc. but i don't have the option to use these languages in my project.

Nealbo
  • 529
  • 4
  • 20
user359187
  • 2,269
  • 6
  • 29
  • 44
  • if you have the knowledge about the format of PDF and it's docs, you can...if you use Blobs...probably, not sure though! – Parth Thakkar May 21 '12 at 09:58
  • 1
    In short you no please, server side will be much easy: http://forum.jquery.com/topic/converting-html-to-pdf should help you. **or** http://stackoverflow.com/questions/6896592/is-it-possible-to-save-html-page-as-pdf-using-javascript-or-jquery – Tats_innit May 21 '12 at 09:58
  • I don't have permission to write the server side codes. I need to implement it from client side itself means using the javascript only. – user359187 May 21 '12 at 10:17
  • [Duplicated](http://stackoverflow.com/questions/742271/generating-pdf-files-with-javascript) – David Diez May 21 '12 at 10:54

1 Answers1

2

Disclaimer: I am affiliated with ByteScout

Bytescout has new javascript product "PDF Generator SDK for Javascript" which is capable of generating PDF files 100% on client side, probably you may generate PDF with text, images, graphics. Full HTML formatting is not supported, but you can use <b>, <i>, <u> html tags inside text to use rich formatting (new version will include support for <font> and <a href> html tags inside text)

Demo of invoice with logo and table generated: http://bytescout.com/products/developer/pdfgeneratorsdkjs/create_pdf_invoice_javascript.html

Eugene
  • 2,820
  • 19
  • 24
  • Thanks it will really helpful. I have checked it and working in almost all browsers even in ie. But it is not open source product anyway i will check by downloading the trial version. Once gain thanks. – user359187 May 26 '12 at 10:37
  • What if I am using Javascript to update inline ID using `getelementbyid`? How would that work? http://stackoverflow.com/questions/25082395/how-to-export-a-auto-generated-html-to-pdf – SearchForKnowledge Aug 01 '14 at 14:27