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

时间:2013-01-16 16:27:19

标签: c# image pdf itextsharp opacity

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

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

1 个答案:

答案 0 :(得分: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);