We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose. word printing rtf file causes issue

Hello,

Our .Net software uses Aspose Word to print .rtf file, but with some certain printers, such as:

Brother MFC-8950DW/Sanon Imageclass D1320/ HP printer with HP Universal Printing PCL 5 (61.150.2.15717) driver,

we could not to print .rtf file to a .prn file, and system give us some error messages:

Error occurred while printing document to file "C:\Program Files\Tamtron\Distribution Server 3\PowerPath_new\Work Files2\O230708_1_3675837.prn"

Detail:
System.ComponentModel.Win32Exception (0x80004005): A StartDocPrinter call was not issued
at System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument document, PrintEventArgs e)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
at Aspose.Words.Document.Print(PrinterSettings printerSettings, String documentName)
at Tamtron.DS3.Service.AsposeWords.PrintDocument(Document document, String printFile, String printerName, Int16 copies, String pageRange, Int32 tray, Boolean useWord95Printing)

we have tried to print the same file from our software to other printers, it worked, also tried to print file from MS word and our other software, the file could be printed as well. I suspected whether Aspose.word is incompatible with certain printers' driver?

We use Aspose.Words.dll, v2.0.50727

Here are related codes:

private void PrintDocument(Document document, string printFile, string printerName,

short copies, string pageRange, int tray, bool useWord95Printing)

{ … …

if (ExtremeTracing)

TraceExtreme(string.Format("Print document args: doc name=\"{0}\", print file=\"{1}\", "

+ "printer=\"{2}\", copies={3}, page range={4}, tray={5}, use Word 95 printing={6}",

document.OriginalFileName, printFile, printerName, copies, pageRange, tray, useWord95Printing));

… …

// Select the printer through the old WordBasic method because the VBA way changes the default

// printer for the system

//typeof(object).InvokeMember("FilePrintSetup", BindingFlags.InvokeMethod, null,

// document.Application.WordBasic, new object[] { printerName, 1 },

// null, null, new string[] { "Printer", "DoNotSetAsSysDefault" });

// setup the paper tray to print to

int useTray = tray;

if (useTray == 0)

{

PrinterSettings settings = new PrinterSettings();

settings.PrinterName = printerName;

useTray = settings.DefaultPageSettings.PaperSource.RawKind;

}

foreach (Section section in document.Sections)

{

section.PageSetup.FirstPageTray = useTray;

section.PageSetup.OtherPagesTray = useTray;

}

if (ExtremeTracing)

TraceExtreme(String.Format("Setting document paper tray to {0}", useTray));

// the document should have the watermarks and repagination at this point.

PrinterSettings printerSettings = new PrinterSettings();

printerSettings.PrinterName = printerName;

printerSettings.Collate = true;

printerSettings.Copies = copies;

try

{

SetPrintRange(printerSettings, pageRange);

}

catch

{

// not a critical failure if it were to happen. Just note it and move on.

if (VerboseTracing)

TraceVerbose(string.Format("Invalid print range \"{0}\". Printing all pages.", pageRange));

printerSettings.PrintRange = PrintRange.AllPages;

}

if (!string.IsNullOrEmpty(printFile))

{

printerSettings.PrintToFile = true;

printerSettings.PrintFileName = printFile;

}

// finally, we are ready to print the document

if (VerboseTracing)

{

if (printerSettings.PrintToFile)

TraceVerbose(string.Format("Printing document to file \"{0}\"", printFile));

else

TraceVerbose("Printing document directly to printer");

}

… …

// pass a document name for when we are printing to PDF, otherwise the output file

// will be called something generic like "document.pdf" which will be overwritten

// each time.

string docName = Path.GetFileNameWithoutExtension(document.OriginalFileName);

document.Print(printerSettings, docName);

… …

}

catch (Exception ex)

{

if (string.IsNullOrEmpty(printFile))

logSet.Trace.WriteEntry(

string.Format("Error occurred while printing document to printer \"{0}\"", printerName),

TraceLogEntryType.Error, "AsposeWords", "PrintOut", ex.ToString());

else

logSet.Trace.WriteEntry(

string.Format("Error occurred while printing document to file \"{0}\"", printFile),

TraceLogEntryType.Error, "AsposeWords", "PrintOut", ex.ToString());

throw new AsposeWordsException("Error occurred while printing Microsoft Word document to file", ex);

}

}

Document document is an instance of Aspose.Words.Document class, which referred to .rtf file; String printFile is the .prn file name with full path; PrinterSettings is in System.Drawing.dll, v4.0.30319

<w:LatentStyles DefLockedState=“false” DefUnhideWhenUsed=“true”
DefSemiHidden=“true” DefQFormat=“false” DefPriority=“99”
LatentStyleCount=“267”>
<w:LsdException Locked=“false” Priority=“0” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Normal”/>
<w:LsdException Locked=“false” Priority=“9” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“heading 1”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 2”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 3”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 4”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 5”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 6”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 7”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 8”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 9”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 1”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 2”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 3”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 4”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 5”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 6”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 7”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 8”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 9”/>
<w:LsdException Locked=“false” Priority=“35” QFormat=“true” Name=“caption”/>
<w:LsdException Locked=“false” Priority=“10” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Title”/>
<w:LsdException Locked=“false” Priority=“1” Name=“Default Paragraph Font”/>
<w:LsdException Locked=“false” Priority=“11” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Subtitle”/>
<w:LsdException Locked=“false” Priority=“22” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Strong”/>
<w:LsdException Locked=“false” Priority=“20” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Emphasis”/>
<w:LsdException Locked=“false” Priority=“59” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Table Grid”/>
<w:LsdException Locked=“false” UnhideWhenUsed=“false” Name=“Placeholder Text”/>
<w:LsdException Locked=“false” Priority=“1” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“No Spacing”/>
<w:LsdException Locked=“false” Priority=“60” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Shading”/>
<w:LsdException Locked=“false” Priority=“61” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light List”/>
<w:LsdException Locked=“false” Priority=“62” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Grid”/>
<w:LsdException Locked=“false” Priority=“63” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 1”/>
<w:LsdException Locked=“false” Priority=“64” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 2”/>
<w:LsdException Locked=“false” Priority=“65” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 1”/>
<w:LsdException Locked=“false” Priority=“66” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 2”/>
<w:LsdException Locked=“false” Priority=“67” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 1”/>
<w:LsdException Locked=“false” Priority=“68” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 2”/>
<w:LsdException Locked=“false” Priority=“69” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 3”/>
<w:LsdException Locked=“false” Priority=“70” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Dark List”/>
<w:LsdException Locked=“false” Priority=“71” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Shading”/>
<w:LsdException Locked=“false” Priority=“72” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful List”/>
<w:LsdException Locked=“false” Priority=“73” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Grid”/>
<w:LsdException Locked=“false” Priority=“60” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Shading Accent 1”/>
<w:LsdException Locked=“false” Priority=“61” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light List Accent 1”/>
<w:LsdException Locked=“false” Priority=“62” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Grid Accent 1”/>
<w:LsdException Locked=“false” Priority=“63” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 1 Accent 1”/>
<w:LsdException Locked=“false” Priority=“64” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 2 Accent 1”/>
<w:LsdException Locked=“false” Priority=“65” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 1 Accent 1”/>
<w:LsdException Locked=“false” UnhideWhenUsed=“false” Name=“Revision”/>
<w:LsdException Locked=“false” Priority=“34” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“List Paragraph”/>
<w:LsdException Locked=“false” Priority=“29” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Quote”/>
<w:LsdException Locked=“false” Priority=“30” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Intense Quote”/>
<w:LsdException Locked=“false” Priority=“66” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 2 Accent 1”/>
<w:LsdException Locked=“false” Priority=“67” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 1 Accent 1”/>
<w:LsdException Locked=“false” Priority=“68” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 2 Accent 1”/>
<w:LsdException Locked=“false” Priority=“69” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 3 Accent 1”/>
<w:LsdException Locked=“false” Priority=“70” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Dark List Accent 1”/>
<w:LsdException Locked=“false” Priority=“71” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Shading Accent 1”/>
<w:LsdException Locked=“false” Priority=“72” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful List Accent 1”/>
<w:LsdException Locked=“false” Priority=“73” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Grid Accent 1”/>
<w:LsdException Locked=“false” Priority=“60” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Shading Accent 2”/>
<w:LsdException Locked=“false” Priority=“61” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light List Accent 2”/>
<w:LsdException Locked=“false” Priority=“62” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Grid Accent 2”/>
<w:LsdException Locked=“false” Priority=“63” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 1 Accent 2”/>
<w:LsdException Locked=“false” Priority=“64” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 2 Accent 2”/>
<w:LsdException Locked=“false” Priority=“65” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 1 Accent 2”/>
<w:LsdException Locked=“false” Priority=“66” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 2 Accent 2”/>
<w:LsdException Locked=“false” Priority=“67” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 1 Accent 2”/>
<w:LsdException Locked=“false” Priority=“68” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 2 Accent 2”/>
<w:LsdException Locked=“false” Priority=“69” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 3 Accent 2”/>
<w:LsdException Locked=“false” Priority=“70” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Dark List Accent 2”/>
<w:LsdException Locked=“false” Priority=“71” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Shading Accent 2”/>
<w:LsdException Locked=“false” Priority=“72” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful List Accent 2”/>
<w:LsdException Locked=“false” Priority=“73” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Grid Accent 2”/>
<w:LsdException Locked=“false” Priority=“60” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Shading Accent 3”/>
<w:LsdException Locked=“false” Priority=“61” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light List Accent 3”/>
<w:LsdException Locked=“false” Priority=“62” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Grid Accent 3”/>
<w:LsdException Locked=“false” Priority=“63” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 1 Accent 3”/>
<w:LsdException Locked=“false” Priority=“64” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 2 Accent 3”/>
<w:LsdException Locked=“false” Priority=“65” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 1 Accent 3”/>
<w:LsdException Locked=“false” Priority=“66” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 2 Accent 3”/>
<w:LsdException Locked=“false” Priority=“67” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 1 Accent 3”/>
<w:LsdException Locked=“false” Priority=“68” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 2 Accent 3”/>
<w:LsdException Locked=“false” Priority=“69” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 3 Accent 3”/>
<w:LsdException Locked=“false” Priority=“70” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Dark List Accent 3”/>
<w:LsdException Locked=“false” Priority=“71” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Shading Accent 3”/>
<w:LsdException Locked=“false” Priority=“72” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful List Accent 3”/>
<w:LsdException Locked=“false” Priority=“73” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Grid Accent 3”/>
<w:LsdException Locked=“false” Priority=“60” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Shading Accent 4”/>
<w:LsdException Locked=“false” Priority=“61” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light List Accent 4”/>
<w:LsdException Locked=“false” Priority=“62” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Grid Accent 4”/>
<w:LsdException Locked=“false” Priority=“63” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 1 Accent 4”/>
<w:LsdException Locked=“false” Priority=“64” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 2 Accent 4”/>
<w:LsdException Locked=“false” Priority=“65” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 1 Accent 4”/>
<w:LsdException Locked=“false” Priority=“66” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 2 Accent 4”/>
<w:LsdException Locked=“false” Priority=“67” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 1 Accent 4”/>
<w:LsdException Locked=“false” Priority=“68” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 2 Accent 4”/>
<w:LsdException Locked=“false” Priority=“69” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 3 Accent 4”/>
<w:LsdException Locked=“false” Priority=“70” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Dark List Accent 4”/>
<w:LsdException Locked=“false” Priority=“71” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Shading Accent 4”/>
<w:LsdException Locked=“false” Priority=“72” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful List Accent 4”/>
<w:LsdException Locked=“false” Priority=“73” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Grid Accent 4”/>
<w:LsdException Locked=“false” Priority=“60” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Shading Accent 5”/>
<w:LsdException Locked=“false” Priority=“61” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light List Accent 5”/>
<w:LsdException Locked=“false” Priority=“62” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Grid Accent 5”/>
<w:LsdException Locked=“false” Priority=“63” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 1 Accent 5”/>
<w:LsdException Locked=“false” Priority=“64” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 2 Accent 5”/>
<w:LsdException Locked=“false” Priority=“65” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 1 Accent 5”/>
<w:LsdException Locked=“false” Priority=“66” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 2 Accent 5”/>
<w:LsdException Locked=“false” Priority=“67” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 1 Accent 5”/>
<w:LsdException Locked=“false” Priority=“68” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 2 Accent 5”/>
<w:LsdException Locked=“false” Priority=“69” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 3 Accent 5”/>
<w:LsdException Locked=“false” Priority=“70” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Dark List Accent 5”/>
<w:LsdException Locked=“false” Priority=“71” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Shading Accent 5”/>
<w:LsdException Locked=“false” Priority=“72” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful List Accent 5”/>
<w:LsdException Locked=“false” Priority=“73” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Grid Accent 5”/>
<w:LsdException Locked=“false” Priority=“60” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Shading Accent 6”/>
<w:LsdException Locked=“false” Priority=“61” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light List Accent 6”/>
<w:LsdException Locked=“false” Priority=“62” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Grid Accent 6”/>
<w:LsdException Locked=“false” Priority=“63” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 1 Accent 6”/>
<w:LsdException Locked=“false” Priority=“64” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 2 Accent 6”/>
<w:LsdException Locked=“false” Priority=“65” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 1 Accent 6”/>
<w:LsdException Locked=“false” Priority=“66” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 2 Accent 6”/>
<w:LsdException Locked=“false” Priority=“67” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 1 Accent 6”/>
<w:LsdException Locked=“false” Priority=“68” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 2 Accent 6”/>
<w:LsdException Locked=“false” Priority=“69” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 3 Accent 6”/>
<w:LsdException Locked=“false” Priority=“70” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Dark List Accent 6”/>
<w:LsdException Locked=“false” Priority=“71” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Shading Accent 6”/>
<w:LsdException Locked=“false” Priority=“72” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful List Accent 6”/>
<w:LsdException Locked=“false” Priority=“73” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Grid Accent 6”/>
<w:LsdException Locked=“false” Priority=“19” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Subtle Emphasis”/>
<w:LsdException Locked=“false” Priority=“21” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Intense Emphasis”/>
<w:LsdException Locked=“false” Priority=“31” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Subtle Reference”/>
<w:LsdException Locked=“false” Priority=“32” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Intense Reference”/>
<w:LsdException Locked=“false” Priority=“33” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Book Title”/>
<w:LsdException Locked=“false” Priority=“37” Name=“Bibliography”/>
<w:LsdException Locked=“false” Priority=“39” QFormat=“true” Name=“TOC Heading”/>
</w:LatentStyles>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

<![endif]–>

Hi,


Thanks for your inquiry. To ensure a timely and accurate response, it would be great if you please create a standalone runnable simple console application that helps us reproduce your problem on our end and attach it here for testing. As soon as you get this simple application ready, we’ll start investigation into your issue and provide you more information. Also, please attach the RTF document you’re getting this problem with here for testing. Does this problem occur with one particular RTF file or any RTF you print causes this exception? What OS (version) are you using?

Best regards,

Thank you Awais,

The rft is created by uncompressing an image stream which is stored in database.

I will email you the simple application and two sample .rtf file.

The OS is MS server 2003.

The weird part of the issue is that for some printers the print function work perfectly, but for some certain printers, it raises the “The printer output file is empty” error.

Hi,


I have received a .rtf file but there was no console application attached with your email. As soon as we receive it, we will start our investigation into your issue and provide you more information.

Best regards,

Thank you Awais,

I have resent the application through email again, it seems that only one attachment could be added for an email.


Hi,


Thanks for sending your console application. We have found that you’re using a very old version of Aspose.Words i.e. 11.8.0. We suggest you please upgrade to the latest version (14.2.0) from the following link and see how it goes on your end. Hope, this helps.
http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/entry531943.aspx

Best regards,

I used aspose word v14.2, but got the same result:


I will email you the new test application which used Aspose word v14.2.
Please check the new test application and advise.

Thanks

Hi,


I tested your new project on “2857360tmp.rtf” document and it was printed perfectly fine on various soft printers on my end. Could you please check if the same issue also occurs when printing from Microsoft Word application? Please also try this overloaded print method to try discover if a simple call to Document.Print method causes the same problem.

Best regards,

I will test MS word application.

I double check the folder of prn file printed to, in the folder, there is the prn file with the same name typed during the test, but the prn file size is 0kb.

Also please double check the error message:

<span style=“font-size:
12.0pt;font-family:“Times New Roman”,“serif”;mso-fareast-font-family:“Times New Roman””>System.ComponentModel.Win32Exception (0x80004005): A StartDocPrinter call was
not issued

at System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument
document, PrintEventArgs e)

at System.Drawing.Printing.PrintController.Print(PrintDocument document)

at System.Drawing.Printing.PrintDocument.Print()

at Aspose.Words.Document.Print(PrinterSettings printerSettings, String
documentName)

<span style=“font-size:
12.0pt;font-family:“Times New Roman”,“serif”;mso-fareast-font-family:“Times New Roman””>Are those error familiar to you<span style=“font-size:
12.0pt;font-family:“Times New Roman”,“serif”;mso-fareast-font-family:“Times New Roman””><span style=“font-size:
12.0pt;font-family:“Times New Roman”,“serif”;mso-fareast-font-family:“Times New Roman””>?

Thanks

Hi,


For the sake of any correction(s) in Aspose.Words API, I have logged an issue in our issue tracking system. The ID of this issue is WORDSNET-9922. Our development team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

Thank you.

How will i get the updates? In this post or get email?

Hi,


Thanks for your inquiry. Our development team has started doing analysis of this issue. We will keep you posted (via this thread) of any updates.

Best regards,

Hi,


Please share if the problem happens only with .rtf document or with .doc and .docx as well? Does this problem also occur when using a blank document?

Secondly, it seems this is a bug in .NET printer area. Please find attached “SimplePrintDocument” class. To determine if this issue is because of Aspose.Words or with .NET framework itself, please try doing the following steps:

1- Add “SimplePrintDocument.cs” class in your application.
2- Instead of code “document.Print(printerSettings, docName)”, please use the following code:

SimplePrintDocument simplePrintDocument = new SimplePrintDocument(“text”);
simplePrintDocument.PrinterSettings = printerSettings;
simplePrintDocument.Print();

Please let us know if the above code still throws the same exception.

Best regards,

The issue does not only happen on .rtf file, I just created a new blank .doc file and test with the application, raise the same error as well.

I will create the test application with the “SimplePrintDocument” class to test, and will update you with the test result.

Thanks

Tested the above codes, the application raised the same error.

Thanks

Tested the “SimplePrintDocument” class on client site, it raised the same error.

Do you have any suggestion on next step issue investigation?

Thanks

Hi,


Thanks for the details. We will check this further and get back to you soon. Also, a quick search in Google reveals some links similar to your problem. Please check if they help:

http://support.microsoft.com/kb/121074
http://h30499.www3.hp.com/t5/Windows-Server-2003/A-StartDocPrinter-call-was-not-issued/td-p/3281601#.Uz1NaKh_sb0
http://social.technet.microsoft.com/Forums/windows/en-US/1dcc2606-b21d-4141-998c-2f371dd62fba/error-startdocprinter-call-was-not-issued?forum=w7itprogeneral

Best regards,

Hi,

I have checked the links, but it seems not the case of this issue, let me provide some more information:

The issued printers do not have password protected, and files(no matter .rtf or doc or others formats) can be printed out correctly through the printers when we print the files from MS word, or our another software which is developed in Delphi.

In addition, if we connected to some other printers, printing from our .NET application did not raise the error as well.

Comparing the setting of the issued printers and correct ones, the only different is the printer model. The issued printers are “all-in-one” units, and we have tried multiple drivers downloads form internet/manufacturer, with no luck printing through the .NET application.

Thanks
<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–>

Hi,


Thanks for the additional information. SimplePrintDocument is not a part of Aspose.Words API and since the exception still occurs when using SimplePrintDocument, we believe this is some problem with .NET framework itself. Our development team has completed the analysis of this issue and has come to a conclusion that this issue you’re observing with a particular printer is actually not a bug in Aspose.Words. So, we will most likely close this issue as ‘Not a Bug’. We apologize for any inconvenience.

Best regards,