Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to set the DPI of output pdf using FPDF library?

Tags:

php

fpdf

Is there a way to reduce the DPI of an output pdf without affecting its size using FPDF library?

like image 602
Abhishek Avatar asked Apr 16 '12 17:04

Abhishek


1 Answers

As far as I know, PDF documents do not have DPI settings, given that they are vector objects. I assume you actually refer to embedded raster images (JPEG, GIF...). In that case, just check the documentation for the Image() function: forth and fifth parameters ($w and $h) can express the desired DPI if you write a negative value:

// Insert a logo in the top-left corner at 300 dpi
$pdf->Image('logo.png',10,10,-300);
like image 175
Álvaro González Avatar answered Sep 30 '22 01:09

Álvaro González