PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Feb 26, 2021 1:17 am

All times are UTC

Forum rules

Please read this before posting on this forum: Forum Rules

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Nov 14, 2018 2:50 am 

Joined: Fri Jul 27, 2018 3:29 am
Posts: 19
Hi, Im trying your sample code for draw an image (jpg) to pdf. Below is my code.

           // Create a new PDF document
            PdfDocument document = new PdfDocument();
            PdfPage page = document.AddPage();
            XGraphics gfx = XGraphics.FromPdfPage(page);

            XImage image = XImage.FromFile("D:\\imageFile.jpg");

            // draw image to pdf
            gfx.DrawImage(image, 0, 0, 250, 140);

            // Save the document...
            string filename = "D:\\test.pdf";

But it not working, it gave me an error. Can anyone help me?
Here I attach the error.

Last edited by boba21 on Wed Nov 14, 2018 9:42 am, edited 1 time in total.

Reply with quote  
PostPosted: Wed Nov 14, 2018 9:22 am 
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3047
Location: Cologne, Germany

This question is not about our library.
I cannot help you with problems that occur with ports of our library. Take the source code of that port and debug it yourself.
Or use the sample code that comes with the port.

Thomas Hoevel
PDFsharp Team

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: Google [Bot] and 18 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group