I tried the above function and get the error below. If I call the overload that takes the PageSettings I do not get the error.
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="Aspose.Pdf.Kit"
StackTrace:
at Aspose.Pdf.Kit.PdfFileInfo.get_NumberofPages()
at Aspose.Pdf.Kit.PdfViewer.PrintDocumentWithSettings(PrinterSettings printerSettings)
at AsposeTest.Program.PrintTest() in C:\Documents and Settings\deweese\My Documents\Visual Studio 2005\Projects\AsposeTest\AsposeTest\Program.cs:line 46
at AsposeTest.Program.Main(String[] args) in C:\Documents and Settings\deweese\My Documents\Visual Studio 2005\Projects\AsposeTest\AsposeTest\Program.cs:line 16
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()