PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Sep 27, 2024 9:27 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sat Aug 08, 2009 4:27 pm 
Offline

Joined: Thu Jun 04, 2009 2:07 pm
Posts: 10
This is the code I use

PdfPage page = outputDocument.AddPage();
page.Size = PdfSharp.PageSize.A4;
XGraphics gfx = XGraphics.FromPdfPage(page);
XImage image = XImage.FromFile("1999 Contest 1.jpg");
gfx.DrawImage(image, 0, 0);

I attached the file. When I open the pdf file, the content is messed up.

Please help.


Attachments:
1999 Contest 1.jpg
1999 Contest 1.jpg [ 61.1 KiB | Viewed 8265 times ]
Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 10, 2009 10:02 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3110
Location: Cologne, Germany
It works with the current internal build of PDFsharp 1.30 (to be released this week).

So if you're using the WPF build, please wait for the new version.

It should already work with the GDI+ build of PDFsharp 1.20.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 10, 2009 8:14 pm 
Offline

Joined: Thu Jun 04, 2009 2:07 pm
Posts: 10
I am currently using the GDI version of 1.2. It fails with the image that I uploaded. It works with the sample jgp that came with pdfsharp. (z3.jpg) though. I will be happy to try out 1.3 once you release it.


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 22, 2009 6:29 am 
Offline

Joined: Thu Jun 04, 2009 2:07 pm
Posts: 10
I downloaded the 1.3 version. I tried with both WPF version and non WPF version. This is still not working. Can you help please?


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 24, 2009 8:33 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3110
Location: Cologne, Germany
It still works here - with the file I saved from the attachment of this thread.

Just in case web server or browser tempered the file: Save the attachment and try that file. If that works, please attach the image in a ZIP file.

If that still doesn't work: which Windows version are you using? I tried it under Windows XP.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 26, 2009 6:54 pm 
Offline

Joined: Thu Jun 04, 2009 2:07 pm
Posts: 10
Thank you Thomas. I discovered the following using the image saved from this site. Essential the image in the website is fine.

It failed to work on Windows 7, both .Net 3.0 and 3.5 versions. This is what I was using.
I tried it on xp machine. It works fine.


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 94 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