-1

I want to download my current web page into pdf on click of download button.Is it possible to do this using php codeigniter or javascript(jquery).Please suggest me.

LoneRanger
  • 117
  • 8

4 Answers4

1

You have to use third party tools like tcpdf to convert your html into pdf document.

Tooba
  • 51
  • 8
1

it is simple to convert your web-page into pdf format.

you can use mPDf or you can use phantomjs

I've use both in may project, work perfect. using phantomjs you can convert your web-page in many formats.

mPDF example:

http://mpdf1.com/manual/index.php?tid=457

phantomjs:

http://phantomjs.org/examples/

in following example is for png or pdf

https://github.com/ariya/phantomjs/blob/master/examples/rasterize.js

archish
  • 152
  • 1
  • 13
0

There are many ways to do this. You can do this on the server side or you can use html5 or a jquery plugin to do this on the client side.

If you're doing it on the server side use a php library such as dompdf or tcpdf and create the file on the server and make it downloadable using proper headers.

If you're doing it on the client browser use a js plugin like jspdf. There are pros and cons on both methods.

Community
  • 1
  • 1
astroanu
  • 3,796
  • 2
  • 35
  • 50
0

Use DOMPDF for create pdf from php.

Download it from below link : https://github.com/dompdf/dompdf

Rav's Patel
  • 693
  • 5
  • 21