Printing to a File : Print « 2D Graphics GUI « Java

Java
1. 2D Graphics GUI
2. 3D
3. Advanced Graphics
4. Ant
5. Apache Common
6. Chart
7. Class
8. Collections Data Structure
9. Data Type
10. Database SQL JDBC
11. Design Pattern
12. Development Class
13. EJB3
14. Email
15. Event
16. File Input Output
17. Game
18. Generics
19. GWT
20. Hibernate
21. I18N
22. J2EE
23. J2ME
24. JDK 6
25. JNDI LDAP
26. JPA
27. JSP
28. JSTL
29. Language Basics
30. Network Protocol
31. PDF RTF
32. Reflection
33. Regular Expressions
34. Scripting
35. Security
36. Servlets
37. Spring
38. Swing Components
39. Swing JFC
40. SWT JFace Eclipse
41. Threads
42. Tiny Application
43. Velocity
44. Web Services SOA
45. XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java » 2D Graphics GUI » PrintScreenshots 
Printing to a File
   
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.Destination;

public class Main {
  public static void main(String[] argvthrows Exception {

    // Set up destination attribute
    PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
    aset.add(new Destination(new java.net.URI("file:e:/temp/out.ps")));

  }
}

   
    
    
  
Related examples in the same category
1. The Printing code which implements Printable
2. Print an Image to print directly
3. Simplest SWT Print ExampleSimplest SWT Print Example
4. Print in Java 2: PrinterJob
5. Print in Java: page format and document
6. Print in Java: Multi page
7. Print in Java 5
8. Print in Java 6
9. Simple Book for printingSimple Book for printing
10. Shapes PrintShapes Print
11. Display the print dialog and print
12. Print the printable area outlinePrint the printable area outline
13. Print the text file and print preview themPrint the text file and print preview them
14. Printable demoPrintable demo
15. Print Swing componentsPrint Swing components
16. BookBook
17. Another print demoAnother print demo
18. Book demoBook demo
19. Printing the Combined-Java 1.2-and-1.4 WayPrinting the Combined-Java 1.2-and-1.4 Way
20. Printing the Java 1.4 Way
21. Prompting for a Printer
22. Printing the Java 1.1 WayPrinting the Java 1.1 Way
23. ScribbleScribble
24. Printable Document
25. PrintFile -- Print a file named on the command linePrintFile -- Print a file named on the command line
26. Print to the standard output
27. PrintPanel is the base for an open-ended series of classesPrintPanel is the base for an open-ended series of classes
28. Print Demo: BookPrint Demo: Book
29. Print Test Print Test
30. Pageable TextPageable Text
31. The area of the printable area
32. The area of the actual page
33. Printing Pages with Different Formats
34. Setting the Orientation of a Printed Page
35. Print Dialog: change the default printer settings(default printer, number of copies, range of pages)
36. Listening for Print Service Status Changes
37. Print Image
38. Overriding the Default Action of a JTextComponent
39. Displaying the Page Format Dialog: changes the default page format such as orientation and paper size.
40. Printable Component
41. Create PageFormats on a higher level
w_ww___.__jav___a_2s.c_o___m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.