Adding a transparent image to a pdf page with PDFsharp
sahin kaya
20
Reputation points
Hello, I am adding an image to the pdf page using the following codes using PDFsharp, but how can I make this image transparent?
document = PdfReader.Open("D:/test/aaa.pdf"); PdfPage lpage = document.Pages[0]; FileStream imageStream = new FileStream("D:/3.jpg", FileMode.Open, FileAccess.Read); XImage image = XImage.FromFile("D:/test/3.jpg"); XGraphics gfx = XGraphics.FromPdfPage(lpage); gfx.DrawImage(image, 50, 50, 200, 200); document.Save("d:/image.pdf");
document.Close();
Developer technologies | C#
11,578 questions
Sign in to answer