PdfPrinterSettings crash on iSeries (Java)

Hi,
I have the next code, and it works fine in a Windows machine, but when I try to excute the code in an iSeries with JDK 7 it crashes the highlighted line.
Any clues?
Thanks.

@SuppressWarnings("deprecation")
private static void printfile(File file, String printerName) {
// Create PdfViewer object
com.aspose.pdf.facades.PdfViewer viewer = new com.aspose.pdf.facades.PdfViewer();

// Open input PDF file
viewer.openPdfFile(file.getAbsolutePath());

// Set attributes for printing
viewer.setAutoResize(true); // Print the file with adjusted size
viewer.setAutoRotate(true); // Print the file with adjusted rotation
viewer.setPrintPageDialog(false); // Do not produce the page number dialog when printing

com.aspose.pdf.printing.PdfPrinterSettings printerSettings = new com.aspose.pdf.printing.PdfPrinterSettings();
printerSettings.setPrinterName(printerName);
viewer.printDocumentWithSettings(printerSettings);
// close the Pdf file.
viewer.closePdfFile();
}

This is the log
Exception in thread "main" java.lang.NullPointerException: value is null
at javax.print.attribute.TextSyntax.verify(TextSyntax.java:89)
at javax.print.attribute.TextSyntax.(TextSyntax.java:83)
at javax.print.attribute.standard.PrinterName.(PrinterName.java
::77)
at com.aspose.pdf.internal.p605.z3.m1(Unknown Source)
at com.aspose.pdf.internal.p565.z40.(Unknown Source)
at com.aspose.pdf.printing.PdfPrinterSettings.(Unknown Source)
at XXXXXXXXXX.PDFPrinterHelper.printfile(PDFPrin
terHelper.java:38)
at XXXXXXXXXX.PDFPrinterHelper.printPDFs(PDFPrin
terHelper.java:21)
at XXXXXXXXXX.App.main(App.java:12)

Hi Josu,


Thanks for contacting support.

When trying to manipulate/print PDF files on Non-Windows platform where fonts used inside PDF file are not installed, such problems exist. However concerning to above stated problem, I have logged an investigation ticket in our issue tracking system as PDFNEWJAVA-35817. 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.

The issues you have found earlier (filed as PDFNEWJAVA-35817) have been fixed in Aspose.Pdf for Java 11.8.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.