PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Sat Sep 13, 2025 10:51 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Aug 21, 2015 2:51 pm 
Offline

Joined: Fri Aug 21, 2015 11:22 am
Posts: 3
Hello,

I'm trying to open a document but I'm getting this exception:

Code:
System.NullReferenceException was unhandled
  HResult=-2147467261
  Message=A referência de objecto não foi definida como uma instância de um objecto.
  Source=PdfSharp
  StackTrace:
       em PdfSharp.Pdf.IO.Parser.ReadTrailer()
       em PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider)
       em PdfSharp.Pdf.IO.PdfReader.Open(String path, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider provider)
       em PdfSharp.Pdf.IO.PdfReader.Open(String path, PdfDocumentOpenMode openmode)
       em testePDF.Form1.btProcessa_Click(Object sender, EventArgs e) em D:\Desenvolvimento\Testes\testePDF\testePDF\Form1.cs:line 73
       em System.Windows.Forms.Control.OnClick(EventArgs e)
       em System.Windows.Forms.Button.OnClick(EventArgs e)
       em System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       em System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       em System.Windows.Forms.Control.WndProc(Message& m)
       em System.Windows.Forms.ButtonBase.WndProc(Message& m)
       em System.Windows.Forms.Button.WndProc(Message& m)
       em System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       em System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       em System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       em System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       em System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       em System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       em System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       em System.Windows.Forms.Application.Run(Form mainForm)
       em testePDF.Program.Main() em D:\Desenvolvimento\Testes\testePDF\testePDF\Program.cs:line 19
       em System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       em System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       em Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       em System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       em System.Threading.ThreadHelper.ThreadStart()
  InnerException:


My code:

Code:
PdfDocument documento = PdfReader.Open(ficheiro, PdfDocumentOpenMode.ReadOnly);


I tried version 1.32 and I was getting the same thing, so I tried version 1.50.338.0 of PdfSharp.

I can't put the pdf in public due to sensitive information. Is there a way to check this?

I also tried to open in Pdf Explorer v1.32 but I also got an error:

https://drive.google.com/file/d/0B-edcK2uWyVXLWk3dXYxUFJ6YlE/view?usp=sharing

Properties of the PDF:

https://drive.google.com/file/d/0B-edcK2uWyVXekhvaUQzNVQ3eGM/view?usp=sharing

Thank you in advance. :)


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 21, 2015 7:55 pm 
Offline
PDFsharp Guru
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 1054
Location: CCAA
AFAIK all known bugs with respect to opening PDF files have been fixed with the latest internal builds of PDFsharp.
If you cannot submit your file for testing, please wait patiently for the next beta. I don't know when it will come, but I hope it will come soon.

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


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 22, 2015 9:21 pm 
Offline

Joined: Fri Aug 21, 2015 11:22 am
Posts: 3
First of all, thank you Thomas to take some time to my problem.

I got the version from nuget package last week. If there is a more recent version of the pdfsharp.dll I would be glad to use it.
If it is possible to send the file only to you, I can do it.

Thank you very much.

Keep up the good work!


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

All times are UTC


Who is online

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