Problems printing documents generated with Aspose.Pdf for Java

Hello Aspose Team,
i have problems to print documents generated with Aspose.Pdf for Java on older printers.
First i generated a document with:

com.aspose.pdf. Document doc = new com.aspose.pdf. Document();

// Save the document

doc.save(“/tmp/document.pdf”);

doc.close();


If I view the document with the Acrobat Reader and look into the preferences, the version of the document is PDF 1.7. If I try to print the document on a HP Laserjet 4050, the message “79.00 FE Printer Error” appears on the printers display. After that I have to switch of the printer. The same problem occurs on a Lexmark printer, the error message is “900.43 RIP Software”.

After that I have tried to save the document in PDF 1.4:
com.aspose.pdf. Document doc = new com.aspose.pdf. Document();

// Save the document

doc.save(“/tmp/document.pdf”);
doc.convert(“/tmp/document.conversion.log”, com.aspose.pdf.PdfFormat.v_1_4, com.aspose.pdf.ConvertErrorAction.Delete);

doc.close();

<span style=“font-size:11.0pt;font-family:“Calibri”,“sans-serif”;
mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:“Times New Roman”;
mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA” lang=“EN-US”>

When I print the document, the same problems described above appear. If I search
for the printers error messages, I will find articles with the information that
this seems to be a postscript level 2 problem.



What can I do to generate PDF documents with Aspose.Pdf for Java that can be
printed on older printers?
<!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Normale Tabelle"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; 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-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

<![endif]–>

Hi Frederic,


Thanks for your inquiry. We will appreciate it if you please share a sample problematic document and share the error messages details/screenshot. Please also share some details about your printing process, whether your are using Aspose.Pdf for Java or some PDF viewer. We will look into the information and will guide you accordingly.

We are sorry for the inconvenience caused.

Best Regards,

Hi Frederic,


Thanks for contacting support.

Please share the complete code snippet which can help us in generating the PDF files which are causing problem while printing, so that we can test the scenario in our environment. We are sorry for this inconvenience.

Hi Nayyer,
here is the code snippet:
// Create PDF
Document doc = new Document();
// Create page
Page page = doc.getPages().add();
PageInfo pageInfo = page.getPageInfo();
pageInfo.setLandscape(false);
// modify page size
MarginInfo marginInfo = pageInfo.getMargin();
//Set the margin Top.
marginInfo.setTop(108);
//Set the margin Bottom.
marginInfo.setBottom(40);
//Set the margin Left.
marginInfo.setLeft(50);
//Set the margin Right.
marginInfo.setRight(50);
Paragraphs paragraphs = page.getParagraphs();

//Instantiate a table object
Table table = new Table();
// Add the table in paragraphs collection of the desired section
paragraphs.add(table);
//Set with column widths of the table
table.setColumnWidths(“150 333”);

//Create MarginInfo object and set its left, bottom, right and top margins
MarginInfo margin = new MarginInfo();
margin.setLeft(5f);
margin.setRight(5f);
margin.setTop(4f);
margin.setBottom(4f);
//Set the default cell padding to the MarginInfo object
table.setDefaultCellPadding(margin);
// empty row
Row row;
Cell cell;
// Autor Name
row = table.getRows().add();
cell = row.getCells().add();
cell.getParagraphs().add(new TextFragment("Author: “));
cell.setBackgroundColor(cf0f0f0);
cell = row.getCells().add();
cell.getParagraphs().add(new TextFragment(“John Do”));
// empty row
row = table.getRows().add();
cell = row.getCells().add();
cell.getParagraphs().add(new TextFragment(” "));
cell.setColSpan(2);
// Release date
row = table.getRows().add();
cell = row.getCells().add();
cell.getParagraphs().add(new TextFragment("Release date: "));
cell.setBackgroundColor(cf0f0f0);
cell = row.getCells().add();
cell.getParagraphs().add(new TextFragment(“2016-01-01”));
doc.convert(“C:/temp/Print-Test.log”, PdfFormat.v_1_4, ConvertErrorAction.Delete);
doc.save(“C:/temp/Print-Test.pdf”);
doc.close();

Hi Frederic,


Thanks for sharing the code snippet.

I have created the PDF file and when I have tried printing the file using Microsoft XPS Document writer, I am unable to notice any problem. However for the sake of correction, I have logged an investigation tickets as PDFNEWJAVA-35789 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

Hi Nayyer,
thanks for your answer.
If i first “print” the document with <!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>DE</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:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</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]–><span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:“Times New Roman”;color:#333333;background:white;
mso-ansi-language:DE;mso-fareast-language:DE;mso-bidi-language:AR-SA”>Microsoft
XPS Document writer in a file, open the generated file with the XPS-Viewer and print the document with the viewer on the HP Laserjet 4050, this works. But this is only a workaround.
Usually it should be possible in one step: Open the document in a pdf viewer (99% Acrobat) and print it directly on the
HP Laserjet 4050.<!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Normale Tabelle"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; 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-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

<![endif]–>

Hi Frederic,


Thanks for sharing the details.

The concerns have been recorded with earlier reported issue and the product team will surely consider them during the resolution of this problem. As soon as we have some further updates, we will let you know.

Hi Nayyer,
how is the state for the resolution of the problem?
We daily will be asked by the users when they can print the pdfs directly.

Hi Frederic,


Thanks for your inquriy. The issue is recently logged and it is still pending for investigation. As soon as investigation of the issue is completed then we will be in good position to share any ETA/workaround with you. We have recorded your concern and we will keep you updated about the issue resolution progress.

We are sorry for the inconvenience caused.

Best Regards,

Hi Tilal,
could you please quote me a date, when the problem will be resolved?
The users lose their patience and if we don’t give a date, the issue will be escalated.

Hi Frederic,


Thanks for your inquiry. I am afraid we can not share any timeline until the issue investigation is completed. However we have recorded your concern and requested our product team to complete the investigation and share an ETA/findings at their earliest. We will notify you as soon as we made significant progress towards issue resolution.

Thanks for your patience and cooperation.

Best Regards,

Hi Frederic,


Thanks for your patience.

Considering the inconvenience which you and your customers have been facing, the priority of issue has been raised to High and product team has planned its investigation in subsequent week. Meanwhile we suggest you to please try printing the document using Foxit Reader/ Sumatra PDF / Nitro PDF Reader / PDF-XChange Viewer and share your findings.

We are sorry for this delay and inconvenience.

Hi Frederic,


Thanks for your patience.

The product team further investigated earlier reported issue and it does not seem to be an Aspose problem. You are trying to print documents using Adobe, and not by Aspose.Pdf for Java . Please note that we do not have specific printer (i.e. HP Laserjet 4050 or Lexmark) to reproduce the problem but we could not reproduce the problem with other printers that we have. At the moment, we advise to try printing the document using pdfViewer class, which prints in a compatible postscript level 1 format. Please try using the above stated workaround and share your findings.

Dear Nayyer,


we followed your advice to test the printing with alternative PDF readers. Indeed with Foxit Reader and Sumatra PDF it is possible to print the PDFs also on our old HP-printer. However this is a workaround we cannot pass to our customer, as there Adobe Reader is the default reader for opening PDFs. Also it is not possible to print the documents from our application using pdfViewer class as the documents need to be stored on hard disk and reopened again, are forwarded by mail and so on, so again will be opened with Adobe Reader for printing.


We want to emphasize, that this printing problem does not appear after the conversion of the MS office document. What we in addition have to do is to create a cover sheet and an appendix with various information and also a footer and header for the documents. For this we use Aspose.PDF and after the final document is created with these stamps, printing is not possible any longer.


So there seems something to happen while stamping the document which is not compatible to postscript 1.


In the meantime our customer induced us to make a test adding stamps with an alternative software and these tests resulted that the documents were printable.


Best regards,


Matthias

/* 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-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; 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-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

<![endif]–>

Hi Frederic,


Thanks for the feedback.

The information has been shared with product team to further investigate the issue and as soon as we have some further updates, we will let you know.

Hello Nayyer,



could you please give us an update about solution progress of this topic? Our customer awaits a final statement until middle of the next week. If we tell our customer that the problem is still in examination, this won’t be acceptable for him, as we tell him exactly this since months. We struggle with this printing problem since almost four months and in case we are not able to raise confidence within next week, the customer will take the decision to go with an alternative software.


Currently we are in negotiation with your company about closing an Enterprise support contract, but this if of course needless when our most important customer stops using the software.



Best regards,


Matthias

Hi Matthias,

Thanks for your patience. We have further investigated the issue and found that this issue is not Aspose.Pdf related but Adobe. Please note new versions of Adobe Reader use postscript 2 for printing so old printers are not recommended. However you can still try to print the document on old printers using advanced printer configuration as following:

1) Choose File > Print, and then click Advanced.
2) Print As Image > select this option. it Prints pages as bitmap images.

Please use this option if normal printing does not produce the desired results, and also specify a resolution. Please note this option is only available for PostScript printers.

Furthermore, you can get additional information about printing from Adobe Acrobat on following links.


https://helpx.adobe.com/acrobat/using/advanced-pdf-print-settings.html#postscript_options
https://helpx.adobe.com/acrobat/kb/printing-complex-pdfs-acrobat.html#main_Change_the_PostScript_options_


Best Regards,

Dear Tilal,


let me summarize the situation again:


  • Printing of the “original” PDF document (without header or footer stamps attached with Aspose.PDF) works without any problems with Adobe reader
  • We tested stamping of the document with an alternative software and printing also worked with Adobe reader
  • Only when we use Aspose.PDF attaching the stamps printing fails with Adobe reader


This indicates that the problems are caused by stamps created with Aspose.PDF. For that it will be impossible to explain our customer that this is an issue with Adobe reader, most of all as we evaluated an alternative software creating stamps without any printing problems.


Best regards,

Matthias

/* 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-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";}

<![endif]–>

Hi Matthias,


Thanks for sharing the details. The information has been shared with product team and they are further looking into this matter in the light of above stated details. As soon as we have some further updates, we will let you know.

Dear Nayyer

we spend a lot of time investigating with some more tests:

  • If we print the converted PDF it works well. (see “Aspose_Print_Problem_With_Stamps.doc” and “OnlyConvertedPDF.pdf”)
  • If we add any Stamp, Appendix, CoverSheet printing is no possible anymore (Error "79.00FE” (HP LaserJet 4050N)).
  • Normally we use a lot of addtional configurations in our stamps like backgroud-colors, special fonts, images, and so on.
  • We have removed every such implemetion from the source-code and tried to use the simple text stamp example from aspose homepage (see SimpleTextStamp_exampleCodeFromAspose.pdf). Same effect. Printing is not possible.
For our customer the standard Adobe Reader (newest Version) is the only acceptable option (without any additional configurations in the Reader).

As already mentioned we made the test to add stamps with an alternative software and with that printing worked also on our old printer.
For that our customer never will accept that this is simply problem caused by adobe reader.

Best Regards

Matthias