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=sharingProperties of the PDF:
https://drive.google.com/file/d/0B-edcK2uWyVXekhvaUQzNVQ3eGM/view?usp=sharingThank you in advance.
