PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Jpg to pdf is not working
https://forum.pdfsharp.net/viewtopic.php?f=2&t=826
Page 1 of 1

Author:  Siva [ Sat Aug 08, 2009 4:27 pm ]
Post subject:  Jpg to pdf is not working

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 8257 times ]

Author:  Thomas Hoevel [ Mon Aug 10, 2009 10:02 am ]
Post subject:  Re: Jpg to pdf is not working

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.

Author:  Siva [ Mon Aug 10, 2009 8:14 pm ]
Post subject:  Re: Jpg to pdf is not working

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.

Author:  Siva [ Sat Aug 22, 2009 6:29 am ]
Post subject:  Re: Jpg to pdf is not working

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?

Author:  Thomas Hoevel [ Mon Aug 24, 2009 8:33 am ]
Post subject:  Re: Jpg to pdf is not working

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.

Author:  Siva [ Wed Aug 26, 2009 6:54 pm ]
Post subject:  Re: Jpg to pdf is not working

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.

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