PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

Transparency
http://forum.pdfsharp.de/viewtopic.php?f=2&t=131
Page 1 of 1

Author:  jcapellman [ Wed May 09, 2007 9:35 pm ]
Post subject:  Transparency

I am trying to lay a transparent PNG over the top of a PDF but it's not working properly. The image shows up, but there is a huge white box covering over half the pdf, the image itself isn't very big in the least.

Code:
        PdfDocument document = PdfReader.Open(filename);

        if (document.Version < 14)
        document.Version = 14;

        PdfPage page = document.Pages[0];
        XGraphics gfx = XGraphics.FromPdfPage(page, XGraphicsPdfPageOptions.Append);

        XImage image = XImage.FromFile("HelloWorld.png");
        gfx.DrawImage(image, 0, 0);

        document.Save(filename);
        Process.Start(filename);

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/