PHP / TCPDF 库 - 将 PDF 中的图像调整为特定的英寸数?
有谁知道如何让 TCPDF 输出具有特定宽度 x 高度英寸数的 .GIF 文件?
我正在尝试将 GIF 嵌入到 PDF 中,以便打印时精确为 4x6 英寸。我尝试了这个:
$this->setpageUnit('in');
$this->Image($tmp, 0, 0, 4, 6, 'gif', '', '', true);
但这似乎只会导致空白页。有什么想法吗?
Does anyone know how to get TCPDF to output a .GIF file with a specific number of inches width x height?
I am trying to get a GIF embedded in a PDF so that it will print at exactly 4x6 inches. I tried this:
$this->setpageUnit('in');
$this->Image($tmp, 0, 0, 4, 6, 'gif', '', '', true);
But that only seemed to result in a blank page. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为发生这种情况是因为您没有使用大写“P”
也许应该是:
I think it's happen because you are not using a capital "P"
maybe is should be :
我认为您需要计算出每英寸有多少像素,然后使用方法
setImageScale(float $scale);
例如:
设置比例后,您的代码应该可以工作:
I think you'll need to figure out how many pixel's per inch and then use the method
setImageScale(float $scale);
For example:
Then your code should work, after setting the scale: