Free Support Forum - aspose.com

Convert word to pdf error

I use aspose.word for .net, and test from word to pdf. Using the attached 888.doc, but it makes error.

C# source code:

private void button2_Click(object sender, EventArgs e)

{

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:

Hi,


Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 15.4.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-11895. Your request has also been linked to the appropriate issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-11895) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for .NET 18.12 update and this Aspose.Words for Java 18.12 update.