PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Jul 20, 2018 8:58 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Jan 26, 2018 7:56 pm 
Offline

Joined: Fri Jan 26, 2018 7:35 pm
Posts: 2
I'm using PDFSharp to create PDF files for printing. all is going well with the exception of drawimage where the image is not an embedded resource. Draw image works fine with embeeded resource such as the "Frogs.jpg" file in the demo. but throughs exception when the image came from a .jpg file from the device.

doesn't matter whether I created the XImage with fromfile or fromstream, the image will say its a "{PdfSharp.Drawing.XImage}", but with the exception of horizontal and verticle resolution (both say 96) all other debugger members say "System.NullReferenceException: Object reference not set to an instance of an object.".
no exceptions from the image load.

when I call the DrawImage I get exception:
{System.NullReferenceException: Object reference not set to an instance of an object.
at PdfSharp.Drawing.XImage.AsJpeg () [0x00007]

Has anybody encountered this before?
Anybody have any suggestions for solution?

I can make a Helloworld sln if need be, but I had the same problem with the "PDFSharp" demo.

Currently trying this in android test.

Thanks in advance for any assistance.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 26, 2018 8:41 pm 
Offline
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 381
Location: CCAA
Hi!
JustDave wrote:
Currently trying this in android test.
The original PDFsharp version does not support Xamarin or Android.
It seems you are using an unofficial port that is not supported on this site.

If you can replicate the issue with the Issue Submission Template and the latest NuGet packages (currently 1.50 beta5) then we will have a look.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 29, 2018 3:49 pm 
Offline

Joined: Fri Jan 26, 2018 7:35 pm
Posts: 2
Thank you for your response Thomas. And once again, (based on reading prior post) this turned out to be not an issue with PDFSharp but the file holding the Image. I had gotten corrupted in the transport process going to the device. I modified that process and now it works fine.

If its an after market port then they did a fine job and from my experience so far PDFSharp is a fine product.

Thanks again.


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 27, 2018 3:18 pm 
Offline

Joined: Fri Apr 27, 2018 3:11 pm
Posts: 1
I have the same problem
XImage.FromFile(path) make exception "Object reference not set to an instance of an object."
XImage.ExistsFile(path) return false.
Parameter path is correct, the file exists.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 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