PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 10:18 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 
Offline

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.

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";
            document.Save(filename);


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.

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

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!

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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
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: Bing [Bot], Google [Bot] and 148 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