使用iTextSharp为PDF中的图像添加透明度/不透明度

本文关键字:添加 透明度 不透明度 图像 iTextSharp PDF 使用 | 更新日期: 2023-09-27 17:54:05

我需要设置图像的不透明度,并使用iTextSharp将其添加到PDF中。我看过http://itextpdf.com/examples/,但找不到任何这样做的工作示例。

谁能帮助我或指导我到正确的资源。

使用iTextSharp为PDF中的图像添加透明度/不透明度

//create new graphics state and assign opacity    
PdfGState graphicsState = new PdfGState();
graphicsState.FillOpacity = 0.2F;  // (or whatever)
//set graphics state to pdfcontentbyte    
pdfData.SetGState(graphicsState);