简体   繁体   中英

Adding transparency / opacity for images in PDF using iTextSharp

I need to set the opacity for an image and add it to the PDF using iTextSharp. I have looked at the http://itextpdf.com/examples/ but could not find any working examples of doing this.

Can anyone help me or direct me to the right resource.

//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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM