Reading in a word doc or docx with a Tray 2 setting causes this error when trying to print:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Error printing with Aspose: System.InvalidOperationException: Cannot convert '260'.
at ؒ.ါ.ူ(Hashtable ေ, Object ဲ, Object ཬ)
at ؒ.ါ.ူ(Hashtable ေ, Object ဲ)
at ✚.䋆.䋝(PaperTray Ӷ)
at ✚.䋆.◄(㺵 䋒, ӟ 䉬)
at Aspose.Words.Document.ԋ(Int32 Ԍ)
at Aspose.Words.Document.RenderToScale(Int32 pageIndex, Graphics graphics, Single x, Single y, Single scale)
at Aspose.Words.Rendering.AsposeWordsPrintDocument.OnPrintPage(PrintPageEventArgs e)
at System.Drawing.Printing.PrintDocument._OnPrintPage(PrintPageEventArgs e)
at System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
at Aspose.Words.Document.Print(PrinterSettings printerSettings, String documentName)
at Aspose.Words.Document.Print(PrinterSettings printerSettings)
at Aspose.Words.Document.Print()
at AMSPrint.Form1.PrintFileWithAsposeClick(Object sender, EventArgs e) in C:\AmsDev\AMSPrint\AMSPrint\Form1.cs:line 177
My code is simply:
try
{
var doc = new Document("C:\\temp\\TestTrays.docx");
doc.Print();
}
catch (Exception e2)
{
AppendText("Error printing with Aspose: " + e2);
}
Or:
try
{
var doc = new Document("C:\\temp\\TestTrays.docx");
var pd = new AsposeWordsPrintDocument(doc);
pd.Print();
}
catch (Exception e2)
{
AppendText("Error printing with Aspose: " + e2);