##Aspose.Words for Java Examples Repository
This package contains Java Example Projects for Aspose.Words for Java.
Aspose.Words for Java is a class library that enables your applications to perform a great range of document processing tasks. Aspose.Words supports DOC, DOCX, RTF, HTML, OpenDocument, PDF, XPS, EPUB and other formats. With Aspose.Words you can generate, modify, convert, render and print documents without utilizing Microsoft Word.
Using Aspose.Words for Java in your project gives you the following benefits:
-
Rich Set of Features
-
No Microsoft Word Automation
-
Platform Independence
-
Performance and Scalability
-
Minimal Learning Curve
These example projects provide helpful demonstrations and code when using Aspose.Words for Java. You will need to download Aspose.Words for Java separately and it will work in evaluation mode.
###Run Examples on your PC
Download the Aspose Examples Dashboard for Java to view and run all these examples on your PC.
Aspose.Words for .NET and Aspose.Words for Java are successful commercial products, but our philosophy is to develop them using our unique "open-source feel" approach. In other words, we at Aspose are extremely customer driven and this shows in:
- Frequent releases (at least 1-2 a month).
- Features are prioritized according to your requests.
- Unlimited free technical support for anyone.
- Helpful support in the forums and answers within 12-24 hours.
- Live chat with experienced technical advisors.
We think that customers who use our products feel that they use an open source product because of the extent they can influence the project, but with the security of a fully committed talented team working on the project.
The Aspose.Words for Java examples published here at GitHub is a part of the above effort.
##What's Included in this Examples Repository?
###Code
Each example is runnable Java class with its own main method. You can run each example separately and in order to view its output.
Example | Description |
---|---|
AddWatermark | Demonstrates how to add a watermark to a Microsoft Word document. |
AppendDocument | Shows how to join two Word documents together and control how they are joined. |
ApplyCustomLogicToEmptyRegions | Shows how to remove empty regions from a document after mail merge using custom logic |
AutoFitTables | Demonstrates how to use the AutoFit function to fit tables to the page width or to content. |
CheckFormat | Shows how to use FileFormatUtil to check input file formats and if they are supported by Aspose.Words. |
CompressImages | Compresses all images in a document that are above the specified PPI. |
CopyBookmarkedText | Extracts text from a bookmarked range and shows how to import it into a new document. |
DocumentInDB | Demonstrates loading and saving a document into a Microsoft Access Database for use in Aspose.Words. |
DocumentPreviewAndPrint | Demonstrates how to generate a print preview of an Aspose.Words Document for use with the Java Print API |
Examples | Contains numerous small but fully working code snippets that are used within the documentation. |
ExtractContent | Provides code to extract fully formatted content from a document between selected nodes. |
ExtractContentBasedOnStyles | Extracts content from a document based on styles. |
FindAndHighlight | Finds and highlights all instances of specified text in a document. |
ImageToPdf | Shows how to convert any common input image formats such as JPEG, PNG, GIF and TIFF to PDF. |
ImportFootnotesFromHtml | Shows how to round trip footnotes by providing code which imports footnotes from HTML. |
ImportTableFromDataTable | Shows how to build a table in a Word document automatically from a Java ResultSet. |
LoadTxt | Demonstrates how to import a .txt file into a new Aspose.Words Document. |
MailMergeFormFields | Shows how to insert checkboxes and form fields during mail merge. |
MulitpleDocsInMailMerge | Produces a new document for every record generated during mail merge. |
MulitplePagesOnSheet | Provides code to print multiple pages from a Word document onto one sheet of paper. |
NestedMailMerge | Shows how to easily merge data directly from a relational data source into a document by using Nested Mail Merge. |
ProcessComments | Prints information about the markup comments found in a input Word document. |
RemoveBreaks | Demonstrates how to remove page and section breaks from a document loaded into Aspose.Words. |
RemoveEmptyRegions | Shows how to easily remove mail merge regions from a document that were not merged with data. |
ReplaceFieldsWithStaticText | Provides code to automatically convert all fields of a certain type to plain text (Ctrl+Shift+F9 in Word). |
SaveAsMultipageTiff | Shows how to save a document with many pages into a multi-paged TIFF image. |
SaveHtmlAndEmail | Demonstrates converting a document to HTML for use in e-mail with the Java Mail API. |
SaveMhtmlAndEmail | Shows how to use Aspose.Words to convert a document to MHTML and then load it into a new .msg email using Aspose.Email for Java |
SplitIntoHtmlPages | Exports a word document into separate HTML articles based on heading styles. |
UntangleRowBookmarks | Demonstrates how to fix bookmarks if they are incorrectly loaded in table rows. |
Word2Help | Expands on the SplitIntoHtmlPages example by producing fully named HTML articles from the source Word document. |
XMLMailMerge | Shows how to perform mail merge from an XML datasource. |
###Data
- Input Documents - Each example directory contains a Data directory which contains any input documents or files used in the example.
- Northwind.mdb - Many examples use this Microsoft Access Database found under the "Database" directory for demonstrating merging data into documents.
###Output
- Most examples will perform operations on documents and save them into the Data directory found in the example directory.
- Other examples print output to the console.
- Some examples may display print preview dialog and print to a specified printer.
###Help Material
For further details on setting up the examples and any requirements refer to the readme.txt found in the root of the repository.
##Download the Examples
Please Download the Aspose.Words for Java Examples to try them at your end.
##How to use the Examples?
Firstly make sure that you have downloaded and extracted the latest version of Aspose.Words for Java. It�s recommended extracting the Aspose.Words for Java archive to the same location as the examples to ensure all dependencies in the examples can be located.
Download the examples from the above link. The .project and .classpath files are provided to allow easy import of the examples for use in IntelliJ IDEA, Eclipse and NetBeans.
Once downloaded you can open the examples by following the instructions below for your chosen IDE:
To import the examples into IntelliJ IDEA 11.0 and above:
- Open IntelliJ and choose File -> Open Project.
- Navigate to the root of the examples folder and select it then press Ok to import.
To import the examples into the workspace of any version of Eclipse:
- Open Eclipse and choose File -> Import.
- From the dialog select General and then Existing Projects into Workspace then press Next.
- Click Browse next to Root Directory and choose the root directory of the examples folder.
- Click Finish to import.
To import the examples into NetBeans 6.0 and above:
- Open NetBeans and choose File -> Import -> Eclipse Project.
- Choose Import Project ignoring Project Dependencies.
- Browse Project to Import and select the root folder of the examples. Choose the same folder for the Destination Folder.
- Click Finish to import.
The examples are sorted into different packages and are ready to compile. To run:
- Intellij IDEA - Right click on the source file and choose Run.
- Eclipse - Right click on the source file and choose Run As -> Java Application.
- NetBeans - Right click on the source file and choose Run File.
Feel free to comment on the samples provided, open issues, discussions and request more samples. We provide full support for this project.
You can contribute by reviewing and sending feedback by trying out new features as they are implemented, submit bugs reports and help us verify fixes as they are released.
We provide full technical support to everyone, regardless of whether they have purchased a license, or are just evaluating the product. Please post a message on the Aspose.Words forum with a description of your issue and any input document/code. We will reply within 12-24 hours with some helpful feedback.
We fix all bugs reported to us and try to implement all features requested by customers. To submit a bug report or for any general inquries, please post a message in the Aspose.Words Forum.
##Contact Us
- Website: www.aspose.com
- Product Home: Aspose.Words for Java
- Download: Download Aspose.Words for Java
- Documentation: Aspose.Words for Java Documentation
- Forum: Aspose.Words for Java Forum
- Blog: Aspose.Words for Java Blog