groege / PdfSharpCore

PdfSharp port NetCore
47 stars 13 forks source link

What is the correct way to place a picture. #23

Open Alexmitter opened 6 years ago

Alexmitter commented 6 years ago

I use the current PDFSharpCore from Nuget on Monodevelop targeting dotnet core 2.1. My question is how to place a picture in the pdf. Current way based on PDFSharp is:

DrawImage(graph, "whatever.gif", 730, 30, 72, 36);   

public static void DrawImage(XGraphics gfx, string jpegSamplePath, int x, int y, int width, int height)
{
            XImage image = XImage.FromFile(jpegSamplePath);
            gfx.DrawImage(image, x, y, width, height);
 }

How is this done in PDFSharpCore?