aspose-words / Aspose.Words-for-Java

Aspose.Words for Java examples, plugins and showcases
https://products.aspose.com/words/java
MIT License
401 stars 206 forks source link

GitHub all releases GitHub

Java API for Various Document Formats

Aspose.Words for Java is an advanced Java Word processing API that enables you to perform a great range of document processing tasks directly within your Java applications. Aspose.Words for Java API supports processing word (DOC, DOCX, OOXML, RTF) HTML, OpenDocument, PDF, EPUB, XPS, SWF and all image formats. With Aspose.Words you can generate, modify, and convert documents without using Microsoft Word.

Directory Description
Examples A collection of Java examples that help you learn the product features.
Plugins Plugins that will demonstrate one or more features of Aspose.Words for Java.

Word API Features

Rendering and Printing

Document Content Features

Reporting Features

For a more comprehensive list of features, please visit Feature Overview.

Read & Write Document Formats

Microsoft Word: DOC, DOCX, RTF, DOT, DOTX, DOTM, DOCM FlatOPC, FlatOpcMacroEnabled, FlatOpcTemplate, FlatOpcTemplateMacroEnabled\ OpenOffice: ODT, OTT\ WordprocessingML: WordML\ Web: HTML, MHTML\ Fixed Layout: PDF\ Text: TXT Other: MD

Save Word Files As

Fixed Layout: XPS, OpenXPS, PostScript (PS)\ Images: TIFF, JPEG, PNG, BMP, SVG, EMF, GIF\ Web: HtmlFixed\ Others: PCL, EPUB, XamlFixed, XamlFlow, XamlFlowPack

Read File Formats

MS Office: DocPreWord60 eBook: MOBI

Supported Environments

Get Started with Aspose.Words for Java

Aspose hosts all Java APIs at the Aspose Repository. You can easily use Aspose.Words for Java API directly in your Maven projects with simple configurations. For the detailed instructions please visit Installing Aspose.Words for Java from Maven Repository documentation page.

Printing Multiple Pages on One Sheet using Java

// Open the document.
Document doc = new Document(dataDir + "TestFile.doc");

// Create a print job to print our document with.
PrinterJob pj = PrinterJob.getPrinterJob();

// Initialize an attribute set with the number of pages in the document.
PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
attributes.add(new PageRanges(1, doc.getPageCount()));

// Pass the printer settings along with the other parameters to the print document.
MultipagePrintDocument awPrintDoc = new MultipagePrintDocument(doc, 4, true, attributes);

// Pass the document to be printed using the print job.
pj.setPrintable(awPrintDoc);

pj.print();

Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License