I am trying to generate PDF from HTML (output of a PHP file).
我正在尝试从HTML (PHP文件的输出)生成PDF。
I am using FPDF to generate the PDFs.
我使用FPDF来生成pdf。
I have three PNG transparent images (Alpha channel), that go on top of each other and it looks like one image.
我有三个PNG透明图像(Alpha通道),它们相互重叠,看起来像一个图像。
The minute FPDF encounters the first image it give me "FPDF error: Alpha channel not supported:"
当FPDF遇到第一个图像时,它会告诉我“FPDF错误:不支持Alpha通道:”
Is there a work arround this. Any help will be much appritiated.
这附近有工作吗?任何帮助都将被告知。
4 个解决方案
#1
3
Actually, there is a fan-made extension that does allow alpha channels. Try it, it is just PHP code: http://www.fpdf.de/downloads/addons/1091/
实际上,有一个扇形扩展允许alpha通道。试试吧,它只是PHP代码:http://www.fpdf.de/downloads/addons/1091/
#2
2
DOMPDF has done the trick for me. It supports the Alpha channels images very well. It manages the CSS floats quite well.
DOMPDF已经帮我完成了这个任务。它很好地支持Alpha通道图像。它能很好地管理CSS浮动。
As compare to non-alpha channel images, it takes alot more time to process tranparent PNG (Alpha Channel images).
与非Alpha通道图像相比,处理超亲和PNG (Alpha通道图像)需要更多的时间。
Because of the size of my HTML and the number of images, my script was taking couple of seconds more than, what is allowed by my host in terms of execution time.
由于HTML的大小和图像的数量,我的脚本比主机允许的执行时间多花了几秒钟。
By increasing the execution time and DOMPDF, now it all works to perfection.
通过增加执行时间和DOMPDF,现在一切都完美了。
I hope it will be helpfull to someone else.
我希望这对别人有帮助。
#3
2
FPDF does not support alpha transparency but it does support index transparency. So just edit your PNG so that it is using index transparency instead. I am using Fireworks and this was an export option for both PNG8 and PNG24.
FPDF不支持alpha透明度,但支持索引透明度。所以只要编辑PNG,它就会使用索引透明性。我正在使用Fireworks,这是PNG8和PNG24的一个导出选项。
#4
0
As stated, FPDF does not support alpha channel, so there's no workaround.
如前所述,FPDF不支持alpha通道,因此没有解决方案。
Maybe you could render a single image and use that?
也许你可以渲染一个图像然后使用它?
#1
3
Actually, there is a fan-made extension that does allow alpha channels. Try it, it is just PHP code: http://www.fpdf.de/downloads/addons/1091/
实际上,有一个扇形扩展允许alpha通道。试试吧,它只是PHP代码:http://www.fpdf.de/downloads/addons/1091/
#2
2
DOMPDF has done the trick for me. It supports the Alpha channels images very well. It manages the CSS floats quite well.
DOMPDF已经帮我完成了这个任务。它很好地支持Alpha通道图像。它能很好地管理CSS浮动。
As compare to non-alpha channel images, it takes alot more time to process tranparent PNG (Alpha Channel images).
与非Alpha通道图像相比,处理超亲和PNG (Alpha通道图像)需要更多的时间。
Because of the size of my HTML and the number of images, my script was taking couple of seconds more than, what is allowed by my host in terms of execution time.
由于HTML的大小和图像的数量,我的脚本比主机允许的执行时间多花了几秒钟。
By increasing the execution time and DOMPDF, now it all works to perfection.
通过增加执行时间和DOMPDF,现在一切都完美了。
I hope it will be helpfull to someone else.
我希望这对别人有帮助。
#3
2
FPDF does not support alpha transparency but it does support index transparency. So just edit your PNG so that it is using index transparency instead. I am using Fireworks and this was an export option for both PNG8 and PNG24.
FPDF不支持alpha透明度,但支持索引透明度。所以只要编辑PNG,它就会使用索引透明性。我正在使用Fireworks,这是PNG8和PNG24的一个导出选项。
#4
0
As stated, FPDF does not support alpha channel, so there's no workaround.
如前所述,FPDF不支持alpha通道,因此没有解决方案。
Maybe you could render a single image and use that?
也许你可以渲染一个图像然后使用它?