It seems that the Java Aspose Word from the website seems to only talk about it’s use on Linux or Windows both on wintel hardware. Has there been any testing of the product on Solaris using Java 6 (1.6)?
We are looking at the product to do printing of RTF documents with an internal only batch job (not a web app). Does the product use standard Java print services lookup and would you expect it to print to a Unix printer queue?
Couple of other questions:
a) As Aspose prints Document which was an RTF file is it converting it to something else (like PDF) as part of the print method?
b) In our project we would be looking to create RTF documents during the course of a day (using MS Word) and saving those RTF documents to be printed at some later point in the day with a Java batch process which would leverage something like the Aspose Word for Java library in this Java batch program (non-interactive) scheduled to run in the off hours. We would expect the number of RTF letters to be from 1000 to 2000 per day and printed once by this batch job to a Unix print queue. Any idea how quickly Aspose can print these to the queue?
Hi there,
Thanks for your inquiry.
SBuresh:
It seems that the Java Aspose Word from the website seems to only talk about it’s use on Linux or Windows both on wintel hardware. Has there been any testing of the product on Solaris using Java 6 (1.6)?
Aspose.Words is platform independent. Aspose.Words for Java is available for Java 1.4, 1.5, 1.6 and 1.7 and will run in any place where Java is installed. Please read following documentation link for your kind reference.
https://docs.aspose.com/words/java/product-overview/
SBuresh:
We are looking at the product to do printing of RTF documents with an internal only batch job (not a web app). Does the product use standard Java print services lookup and would you expect it to print to a Unix printer queue?
You can print your document (rtf) by using Document.Print method. This method prints the whole document to the default printer. You can find different overloads of Print method in the following API page:
http://www.aspose.com/docs/display/wordsjava/Document
SBuresh:
a) As Aspose prints Document which was an RTF file is it converting it to something else (like PDF) as part of the print method?
No, Aspose.Words sends your document directly to printer. You can simply use the Document.Print Method to sends your Word document directly to printer without bringing up any user interface forms. You can find different overloads of Print method in the following API page:
http://www.aspose.com/docs/display/wordsjava/Document
SBuresh:
b) In our project we would be looking to create RTF documents during the course …
Any idea how quickly Aspose can print these to the queue?*
Please use the following code snippet to print the document. You need to load your documents into Aspose.Words.Document and call the Document.Print method for each document. Hope this answers your query. Please let me know if I can be of any further assistance.
Document doc = new Document(getMyDir() + "Document.doc");
doc.print();
Related to performance I have tested trying to print 10 RTF files by using the following code snippet and it seem to take several seconds to print these to the printer queue. This is running on a Solaris Sunfire T200 with 32Meg of memory, single CPU with 8 cores so it decent piece of hardware. Using Java 1.6.0_31-b04.
Running in headless mode, -Xms32m -Xmx384m
I am seeing a 22 sec average, 52 sec max, 14 sec min times to open a file, create the document objec and print it to printer queue (just spooled but not actually printed yet). This seems really slow – is there anyway for me to dump out some debug output to see where it is spending all it’s time – printerservices lookup, … I also profiled just the document object call and that is an average of 4.9 sec, min 0.4 sec and max 24 sec. In all cases it was the first loop interation that had the max times. Is this a typical type of performance I should expect for just an open file and print sequence? The test was with 10 RTF files which had a average byte size of 680K to 15Meg (average size RTF files).
Code snippet:
...
File file = new File(dirName);
File[] fileList = file.listFiles();
if (fileList != null && fileList.length > 0) {
// Loop through directory for RTF files
System.out.println(fileList.length + " Files found");
long startTime = 0;
LoadOptions loadOptions = new LoadOptions();
loadOptions.setLoadFormat(com.aspose.words.LoadFormat.RTF);
for (int i = 0; i < fileList.length; i++) {
startTime = System.currentTimeMillis();
String filePath = fileList[i].getAbsolutePath();
System.out.println("Print file " + filePath);
Document doc = new Document(filePath, loadOptions);
System.out.println("Get file " + i + " and create document object took " + (System.currentTimeMillis() - startTime) + " ms");
if (printerName != null && printerName.length() > 0) {
doc.print(printerName);
} else {
throw new SystemErrorException("AsposeTest", "No printer name defined");
}
System.out.println("Complete print to queue - took total of " + (System.currentTimeMillis() - startTime) + " ms");
}
} else {
throw new InvalidInputException("AsposeTest", "No files found in directory or invalid");
}
Hi there,
Thanks for your inquiry.
In terms of memory, If you are loading huge Word documents into Aspose.Words’ DOM, more memory would be required. This is because during processing, the document needs to be held wholly in memory. Usually, Aspose.Words needs 10 times more memory than the original document size to build a DOM in the memory. It is better to use few small documents instead of one huge document.
Could you please attach your input RTF document here for testing? I will investigate the issue on my side and provide you more information.
Our business need is only to open the RTF and print (non-interactively) the RTF so does that 10x doc size still apply when just opening the document. We do not need to interact with the document or modify it.
I will need to make up a document that has identifying information removed that can be used as a test sample.
Steve
Hi Steve,
Thanks for your inquiry. It is quite difficult to answer such questions because performance and memory usage all depend on complexity and size of the documents you are loading. Please note that usually Aspose.Words needs few times more memory than document size to build model of the document (DOM) in memory. Please read more detail about ‘Performance and Scalability’ from here:
https://docs.aspose.com/words/net/