I use aspose.word for .net, and test from word to pdf. Using the attached 888.doc, but it makes error.
C# source code:
Document doc = new Document(@"E:\zh\888.doc");
doc.Save("temp.pdf", SaveFormat.Pdf);
I run it in vs 2013, the aspose.word version is v2.0.50727 and install it by
PM> Install-Package Aspose.Words
Does it need any license? Please help me.
The error is :
System.NullReferenceException was unhandled
HResult=-2147467261
Message=未将对象引用设置到对象的实例。
Source=Aspose.Words
StackTrace:
在 . ( , Int32 , , Int32 , Int32 )
在 . ( )
在 . ( )
在 . ( )
在 . ()
在 . ()
在 . ()
在 . ( , Int32 )
在 . ( )
在 . ( )
在 . ( , Int32 )
在 . ( , Int32 , Boolean )
在 . ()
在 . ( , Int32 , Boolean , Boolean )
在 . ()
在 . ( , Int32 )
在 . ( )
在 . ()
在 . ( )
在 . ( )
在 . (Boolean )
在 . (Boolean )
在 . ()
在 . (Document , )
在 Aspose.Words.Document.UpdatePageLayout()
在 Aspose.Words.Document. (Boolean )
在 Aspose.Words.Document. ()
在 Aspose.Words.Document.get_PageCount()
在 . ( , )
在 . ( )
在 Aspose.Words.Document. (Stream , String , SaveOptions )
在 Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)
在 Aspose.Words.Document.Save(String fileName, SaveFormat saveFormat)
在 WindowsFormsApplication1.Form1.button2_Click(Object sender, EventArgs e) 位置 e:\zh\pdf\bclconvertimage\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:行号 61
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
在 System.Windows.Forms.Button.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 WindowsFormsApplication1.Program.Main() 位置 e:\zh\pdf\bclconvertimage\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:行号 19
在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException: