سؤال

I am currently using FPDF to generate PDF files. What I would need is to draw alpha-transparent rectangles (say with opacity 0.5) on top of an image.

I cannot find how to do this in FPDF, since SetDrawColor and SetFillColor (which are used to draw the rectangles) only take RGB arguments, no alpha value. So they automatically completely cover images or lines placed there with Image or Line.

How can I generate PDF files from PHP that have semi-transparent colored rectangles on top of a given background image and/or on top of a given set of (dashed/full) lines?

هل كانت مفيدة؟

المحلول

I suddenly bumped into the answer: apparently, transparency is not stored on the color level in PDFs, but on the object level. And this add-on provides functionality for it: http://fpdf.org/en/script/script74.php

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top