• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Implement Custom Printing Logic & Enhanced Word Documents Printing

 
Ranch Hand
Posts: 714
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is new in this release?

Printing is a function that has been around in Aspose.Words for .NET for quite a while. We are proud to announce to that starting in Version 10.5, printing is also fully supported in Aspose.Words for Java. You can easily print all or only specified pages of a document with just a few lines of code.
The Aspose.Words for Java API provides the handy Document.Print method whose overloads allow you to print a document using various different options with just one line of code. You can choose to print using default settings, print to a specific printer by name and even printing options such as page range to print.

Pass Any Document Loaded into Aspose.Words to Standard Java Printing Devices

Aspose.Words provides the AsposeWordsPrintDocument class which allows any document loaded into Aspose.Words to be printed with the standard Java printing API. This class provides the “typical” one document page per physical page printing. The AsposeWordsPrintDocument class implements the following print interfaces:
• Pageable
• Printable
This class can be passed directly to standard Java print classes such as PrinterJob using PrinterJob.setPageable or PrinterJob.setPrintable and allows you to easily print the document with dialogs such as the standard print dialog.

Previewing a Document before Printing

The standard Java API doesn’t provide any existing functions to print preview any Java on its own. With Aspose.Words, not only do we provide the facilities to print documents, we also provide sample code to preview documents before printing in the DocumentPreviewAndPrint sample. The preview provided by the print preview dialog is the same as what is expected when the document it printed to a real printer.

Print Multiple Document Pages onto a Single Sheet of Paper

You can utilize Aspose.Words for Java to fully customise how documents are printed. An example of this is printing multiple document pages onto a physical page by implementing your own print document class. Achieving this using Aspose.Words is a straight forward task. We have already provided the sample code ready for use in the MultiplePagesOnSheet sample.

Implementing Custom Printing Logic

Finally, it’s worth mentioning you can use the built-in methods in the Aspose.Words API to implement your own printing classes based on your own logic. Without going into too much detail, this is the basis of how the previous sample of printing multiple pages on one sheet is implemented. Using such methods as Document.renderToSize, Document.getPageInfo you can use Aspose.Words to integrate with Java’s printing framework, customize the print process to your liking and custom print documents loaded into Aspose.Words.
You can check out an example of this in action by taking a look at the code for the previous sample. The download full code for this sample from here.

Newly added documentation pages and articles

Some new tips and articles have now been added into Aspose.Words for .NET documentation that may guide you briefly how to use Aspose.Words for performing different tasks like the followings.

- How-to: Print Multiple Pages on One Sheet ?
- How-to: Print a Document with Settings and Print Preview ?

Overview: Aspose.Words for .NET

Aspose.Words is a word processing component that enables Java & .NET applications to read, write and modify Word documents without using Microsoft Word. Other useful features include document creation, content and formatting manipulation, mail merge abilities, reporting features, TOC updated/rebuilt, Embedded OOXML, Footnotes rendering and support of DOCX, DOC, WordprocessingML, HTML, XHTML, TXT and PDF formats (requires Aspose.Pdf). It supports both 32-bit and 64-bit operating systems. You can even use Aspose.Words to build applications with Mono.

More about Aspose.Words for .NET

- Homepage Aspose.Words for . Java
- Download Aspose.Words for Java
- Demos for Aspose.Words for .NET
- Online documentation of Aspose.Words for .NET:
- Post your technical questions/queries to Aspose.Words for .NET
- Receive notifications about latest news and supported features by subscribing to Aspose.Words for .NET

Contact Information
Aspose Pty Ltd
Suite 163, 79 Longueville Road
Lane Cove, NSW, 2066
Australia
Aspose - Your File Format Experts
sales@aspose.com
Phone: 888.277.6734
Fax: 866.810.9465
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nice post.I'm impressed by your post.Its really very helpful for custom printing.Thanks for the useful information.



Business card template
 
Get me the mayor's office! I need to tell her about this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic