NewUser
NewUser

Reputation: 13333

Print docs in PDF format in Yii

I have made an application in Yii. Now as per my application requirement I have to make them print in PDF format. I searched over Yii docs but did not got any docs about converting file into printable PDF format. So any help and suggestions will be highly appreciable.

Upvotes: 0

Views: 5222

Answers (6)

asela daskon
asela daskon

Reputation: 564

Hers the extension to create PDF files. Yii2-PDF

Upvotes: 0

acorncom
acorncom

Reputation: 5955

Look into WkHtmlToPdf: http://code.google.com/p/wkhtmltopdf/

It uses Webkit's rendering engine to make PDFs from HTML / CSS. It's the best library out there that I've found and I've done a bunch of research.

Edit: Mike on the Yii forum has already built an OO wrapper for WkHtmlToPdf and just released a Yii extension for it.

Upvotes: 2

KahWee Teng
KahWee Teng

Reputation: 14178

Unfortunately this feature is not part of Yii. You can try TCPDF, though. http://www.tcpdf.org/

TCPDF lets you parses your HTML output to PDF document. The PDF document can be output in your server or to the user as a direct download.

Upvotes: 0

LostSalad
LostSalad

Reputation: 398

I have recently used MPDF for a project. It allows you to convert HTML output into PDF format. If you are looking for something simple this might be what you are looking for. Personally, I find it easier to work with HTML/CSS for layout than PDF boxes. I am not sure just how well it scales with complex layouts, though.

Yii also supports using Zend modules. You can use Zend_Pdf if you so choose.

See this documentation page on how to integrate third-party libraries with your Yii code.

Either way, as has already been mentioned, there are tons of PDF libraries available for PHP.

Upvotes: 1

mewm
mewm

Reputation: 1277

I have had great success using fpdf - http://www.fpdf.org/

Upvotes: 0

Mukesh Soni
Mukesh Soni

Reputation: 6668

You should search for php libraries to do that. Link to one of them - http://www.tcpdf.org/

Upvotes: 0

Related Questions