Why is TCPDF Image smaller than it should be?

旧街凉风 提交于 2019-11-30 08:30:17
$pdf->SetAutoPageBreak(false, 0);

If someone is having the same problem, this is how i solved it. I hate it when i find people with the same exact problem i have and don't get back with the answer after they solved it.

Eduardo Rivera Digital

i agree with @Bobby Tables, so for that reason i will share what works for me... in my case i was looking for create a PDF in a personalized size (for print ID cards) for me the problem that i find was not in the code, was in the system, look, I had to set or create an profile or "New paper size" in the printer devices of windows, control panel/ hardware and sound / device and printer,... there select microsoft print to pdf, and now, in the superior navigation bar select "print server properties", in the open windows, click on "change form settings", and then, check "create a new form", now set the dimensión in inches, but in tcpdf the size is in "mm" millimeters, (you need to convert from mm to inches first), so put a name for the "new form or paper size", now save all, and restart the web browsers, ... go to your site and test it!,

now when you output you pdf to print just select the name of the "paper size" created by you, in advance tab, or more config options, and "there is" the size fit exact!....

i solved similar problem removing

$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

from my code

I got problem with displaying the image in correct size and the following code did the trick:

$pdf->setImageScale(1.53);

Hope it helps others.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!