Reputation: 1426
Currently I am using a TCPDF library to create html into PDF. The pdf file which is creating is of low resolution ( 72 dpi ).
I want to know is there any better way to create a high-resolution pdf (300 dpi) ?
Thanks
Upvotes: 0
Views: 4387
Reputation: 6900
You can increase the value in set image scale to get quality
$pdf->setImageScale(1.53);
more info from author below,
Suppose that you want to print a web page larger 1024 pixels to fill all the available page width.
An A4 page is larger 210mm equivalent to 8.268 inches, if you subtract 13mm (0.512") of margins for each side, the remaining space is 184mm (7.244 inches).
The default resolution for a PDF document is 300 DPI (dots per inch), so you have 7.244 * 300 = 2173.2 dots (this is the maximum number of points you can print at 300 DPI for the given width).
The conversion ratio is approximatively 1024 / 2173.2 = 0.47 px/dots.
If the web page is larger 1280 pixels, on the same A4 page the conversion ratio to use is 1280 / 2173.2 = 0.59 pixels/dots';
Upvotes: 1