Dear Aspose Team,
Hi Wolfgang,
Thanks for your inquiry. We are working over your query and will update you asap.
Hello Tahir,
Can you provide some detailed information about the AsposeWordsPrintDocument class. We assume that at least under Linux the output is already a Postscript. Can you (your developer team) confirm that? What is the difference of processing the documents using that class on Windows vs. on Linux. It seems that the output is different.Is there an option to get in contact with the developer / architect directly?
Hi Wolfgang,
Thanks for your patience. AsposeWordsPrintDocument provides a default implementation for printing of a Document within the Java printing framework.
AsposeWordsPrintDocument overrides both java.awt.print.Printable and java.awt.print.Pageable.
A single Aspose.Words document can consist of multiple sections that specify pages with different sizes, orientation and paper trays. AsposeWordsPrintDocument should be used as java.awt.print.Pageable to properly print each of the different paper size, orientation, etc.
I have tested the scenario at Ubuntu with a shared printer (print files to PS) using latest version of Aspose.Words for Java 15.8.0 and have not found the shared issue. Please use Aspose.Words for Java 15.8.0. I have attached the output PS file with this post for your kind reference.
Chrons:
Can you provide some detailed information about the AsposeWordsPrintDocument class. We assume that at least under Linux the output is already a Postscript. Can you (your developer team) confirm that? What is the difference of processing the documents using that class on Windows vs. on Linux. It seems that the output is different.
Is there an option to get in contact with the developer / architect directly?
I am in communication about this query with our product team. We will update you asap.
Hi Tahir,
Hi Wolfgang,
Thanks for your inquiry. Could you please use the following code example to generate the PS file and share it here for our reference?
Document doc = new Document(getMyDir() + “in.docx”);
AsposeWordsPrintDocument awPrintDoc = new AsposeWordsPrintDocument(doc);DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
PrintService[] services = PrintServiceLookup.lookupPrintServices(flavor, null);
PrintService printService = null;for (PrintService service : services) {
if (service.getName().equalsIgnoreCase(“HP Universal Printing PS”)) {
printService = service;
}
}if (printService != null) {
URI printToFileURI <font color="BLUE" size="+1">=</font> <font color="BLUE" size="+1"><b>(</b></font>Paths<font color="BLUE" size="+1"><b>.</b></font>get<font color="BLUE" size="+1"><b>(</b></font>getMyDir<font color="BLUE" size="+1"><b>(</b></font><font color="BLUE" size="+1"><b>)</b></font> <font color="BLUE" size="+1">+</font> <font color="PURPLE">"awjava-15.8.0.ps"</font><font color="BLUE" size="+1"><b>)</b></font><font color="BLUE" size="+1"><b>.</b></font>toUri<font color="BLUE" size="+1"><b>(</b></font><font color="BLUE" size="+1"><b>)</b></font><font color="BLUE" size="+1"><b>)</b></font><font color="BLUE" size="+1"><b>;</b></font> Destination ds <font color="BLUE" size="+1">=</font> <font color="RED"><b>new</b></font> Destination<font color="BLUE" size="+1"><b>(</b></font>printToFileURI<font color="BLUE" size="+1"><b>)</b></font><font color="BLUE" size="+1"><b>;</b></font> aset<font color="BLUE" size="+1"><b>.</b></font>add<font color="BLUE" size="+1"><b>(</b></font>ds<font color="BLUE" size="+1"><b>)</b></font><font color="BLUE" size="+1"><b>;</b></font> PrinterJob pj <font color="BLUE" size="+1">=</font> PrinterJob<font color="BLUE" size="+1"><b>.</b></font>getPrinterJob<font color="BLUE" size="+1"><b>(</b></font><font color="BLUE" size="+1"><b>)</b></font><font color="BLUE" size="+1"><b>;</b></font> pj<font color="BLUE" size="+1"><b>.</b></font>setPrintService<font color="BLUE" size="+1"><b>(</b></font>printService<font color="BLUE" size="+1"><b>)</b></font><font color="BLUE" size="+1"><b>;</b></font> pj<font color="BLUE" size="+1"><b>.</b></font>setPageable<font color="BLUE" size="+1"><b>(</b></font>awPrintDoc<font color="BLUE" size="+1"><b>)</b></font><font color="BLUE" size="+1"><b>;</b></font> <font color="RED"><b>try</b></font> <font color="BLUE" size="+1"><b>{</b></font> pj<font color="BLUE" size="+1"><b>.</b></font>print<font color="BLUE" size="+1"><b>(</b></font>aset<font color="BLUE" size="+1"><b>)</b></font><font color="BLUE" size="+1"><b>;</b></font> <font color="BLUE" size="+1"><b>}</b></font> <font color="RED"><b>catch</b></font> <font color="BLUE" size="+1"><b>(</b></font>Exception e<font color="BLUE" size="+1"><b>)</b></font> <font color="BLUE" size="+1"><b>{</b></font> System<font color="BLUE" size="+1"><b>.</b></font>out<font color="BLUE" size="+1"><b>.</b></font>println<font color="BLUE" size="+1"><b>(</b></font>e<font color="BLUE" size="+1"><b>.</b></font>getMessage<font color="BLUE" size="+1"><b>(</b></font><font color="BLUE" size="+1"><b>)</b></font> <font color="BLUE" size="+1">+</font> <font color="PURPLE">"____"</font> <font color="BLUE" size="+1">+</font> e<font color="BLUE" size="+1"><b>)</b></font><font color="BLUE" size="+1"><b>;</b></font> <font color="BLUE" size="+1"><b>}</b></font>}
1. We assume that at least under Linux the output is already a Postscript. Can you confirm that? Does Aspose.Words first create PS file and then print it? While printing Aspose.Words doesn’t create any files itself either under Windows or Linux. AsposeWordsPrintDocument is a wrapper which implements Printable, Pageable interfaces and relies on Java implementation and system drivers i.e. AsposeWordsPrintDocument works with Java Printing API PrinterJob pj = PrinterJob.getPrinterJob(); pj.setPrintService(printer); … pj.print(attributes); // attributes contains new Destination(“your_ps_file.ps”) For more details please have a look at https://docs.oracle.com/javase/tutorial/2d/printing/set.html http://docs.oracle.com/javase/8/docs/api/javax/print/attribute/standard/Destination.html 2. What is the difference of processing the documents using that class on Windows vs. on Linux. It seems that the output is different. As I said before there is no difference between Windows and Unix printing workflow (see Java Printing API). The output is different on different platforms because of Java and system drivers. > When we directly convert the document to Postscript, using Aspose.Words save functionality, the issue is not appearing Correct, in this case AW knows how to use fonts substitutions and handle known fonts issues. . Since AW uses Java API Printing which in turn uses system drivers I can assume that if you installed missed fonts on Linux itself it would help to solve the issue. See e.g. ttf-mscorefonts-installer
Hi again,
Hi Wolfgang,
Thanks for your feedback. There is a possibility that with Aspose.Words v15.9.0, this issue will not appear. Please wait for next version of Aspose.Words v15.9.0. We will inform you via this forum thread once new version of Aspose.Words will be available. Thanks for your patience.
Hi Tahir,
Hi again,
Hi Wolfgang,
Thanks for your feedback. We have logged a task as WORDSJAVA-1168 for investigations. We will inform you via this forum thread once there is any update available on this issue.
Thanks for your patience.
Hello Vyacheslav Durin,
Hi Wolfgang,
Hi,
The issues you have found earlier (filed as WORDSJAVA-1168) have been fixed in this .NET update and this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.