FPDF error: alpha channel not supported:

I am trying to create a PDF from HTML (PHP file output).

I use FPDF to create PDF files.

I have three transparent PNG images (Alpha channel) that go together, and this looks like a single image.

Minute FPDF encounters the first image that it gives me "FPDF error: alpha channel is not supported:"

Is there such a job. Any help would be much indicated.

+4
source share
4 answers

DOMPDF helped. It supports Alpha channel images very well. It manages CSS floats well.

Compared to non-alpha channel images, it takes a lot of time to process transparent PNGs (Alpha Channel images).

Due to the size of my HTML and the number of images, my script took a couple of seconds longer than what was allowed by my host in terms of runtime.

By increasing runtime and DOMPDF, everything now works to perfection.

I hope this will be useful to someone else.

+2
source

In fact there is an extension made by a fan that allows alpha channels. Try it, it's just PHP code: http://www.fpdf.de/downloads/addons/1091/

+3
source

FPDF does not support alpha transparency, but supports index transparency. So just edit your PNG to use index transparency instead. I use Fireworks and it was an export option for PNG8 and PNG24.

+2
source

As indicated, FPDF does not support alpha channel, so there is no workaround.

Maybe you can make one image and use it?

0
source

Source: https://habr.com/ru/post/1440340/


All Articles