我需要为图像设置不透明度,并使用iTextSharp将其添加到PDF中。我查看了http://itextpdf.com/examples/,但找不到任何可行的例子。
任何人都可以帮助我或指导我找到合适的资源。
答案 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);