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

Bli*_*dit 2 c# pdf image itextsharp opacity

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

任何人都可以帮助我或指导我找到合适的资源.

Rac*_*len 5

//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);
Run Code Online (Sandbox Code Playgroud)