Java Doc for PrintTranscoder.java in  » Graphic-Library » batik » org » apache » batik » transcoder » print » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
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 Source Code / Java Documentation » Graphic Library » batik » org.apache.batik.transcoder.print 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.batik.transcoder.SVGAbstractTranscoder
   org.apache.batik.transcoder.print.PrintTranscoder

PrintTranscoder
public class PrintTranscoder extends SVGAbstractTranscoder implements Printable(Code)
This class is a Transcoder that prints SVG images. This class works as follows: any-time the transcode method is invoked, the corresponding input is cached and nothing else happens.
However, the PrintTranscoder is also a Printable. If used in a print operation, it will print each of the input it cached, one input per page.
The PrintTranscoder uses several different hints that guide its printing:
  • KEY_LANGUAGE, KEY_USER_STYLESHEET_URI, KEY_PIXEL_TO_MM, KEY_XML_PARSER_CLASSNAME can be used to set the defaults for the various SVG properties.
  • KEY_PAGE_WIDTH, KEY_PAGE_HEIGHT, KEY_MARGIN_TOP, KEY_MARGIN_BOTTOM, KEY_MARGIN_LEFT, KEY_MARGIN_RIGHT and KEY_PAGE_ORIENTATION can be used to specify the printing page characteristics.
  • KEY_WIDTH, KEY_HEIGHT can be used to specify how to scale the SVG image
  • KEY_SCALE_TO_PAGE can be used to specify whether or not the SVG image should be scaled uniformly to fit into the printed page or if it should just be centered into the printed page.

author:
   Vincent Hardy
version:
   $Id: PrintTranscoder.java 489226 2006-12-21 00:05:36Z cam $


Field Summary
final public static  StringKEY_AOI_STR
    
final public static  StringKEY_HEIGHT_STR
    
final public static  StringKEY_LANGUAGE_STR
    
final public static  TranscodingHints.KeyKEY_MARGIN_BOTTOM
     The marginBottom key.
final public static  StringKEY_MARGIN_BOTTOM_STR
    
final public static  TranscodingHints.KeyKEY_MARGIN_LEFT
     The marginLeft key.
final public static  StringKEY_MARGIN_LEFT_STR
    
final public static  TranscodingHints.KeyKEY_MARGIN_RIGHT
     The marginRight key.
final public static  StringKEY_MARGIN_RIGHT_STR
    
final public static  TranscodingHints.KeyKEY_MARGIN_TOP
     The marginTop key.
final public static  StringKEY_MARGIN_TOP_STR
    
final public static  TranscodingHints.KeyKEY_PAGE_HEIGHT
     The pageHeight key.
final public static  StringKEY_PAGE_HEIGHT_STR
    
final public static  TranscodingHints.KeyKEY_PAGE_ORIENTATION
     The pageOrientation key.
final public static  StringKEY_PAGE_ORIENTATION_STR
    
final public static  TranscodingHints.KeyKEY_PAGE_WIDTH
     The pageWidth key.
final public static  StringKEY_PAGE_WIDTH_STR
    
final public static  StringKEY_PIXEL_TO_MM_STR
    
final public static  TranscodingHints.KeyKEY_SCALE_TO_PAGE
     The scaleToPage key.
final public static  StringKEY_SCALE_TO_PAGE_STR
    
final public static  TranscodingHints.KeyKEY_SHOW_PAGE_DIALOG
     The showPageDialog key.
final public static  StringKEY_SHOW_PAGE_DIALOG_STR
    
final public static  TranscodingHints.KeyKEY_SHOW_PRINTER_DIALOG
     The showPrinterDialog key.

Key:

KEY_SHOW_PAGE_DIALOG

Value:

Boolean

Default:

false

Required:

No

Description:

Specifies whether or not the transcoder should pop up a dialog box for selecting the printer.
final public static  StringKEY_SHOW_PRINTER_DIALOG_STR
    
final public static  StringKEY_USER_STYLESHEET_URI_STR
    
final public static  StringKEY_WIDTH_STR
    
final public static  StringKEY_XML_PARSER_CLASSNAME_STR
    
final public static  StringUSAGE
    
final public static  StringVALUE_MEDIA_PRINT
    
final public static  StringVALUE_PAGE_ORIENTATION_LANDSCAPE
    
final public static  StringVALUE_PAGE_ORIENTATION_PORTRAIT
    
final public static  StringVALUE_PAGE_ORIENTATION_REVERSE_LANDSCAPE
    

Constructor Summary
public  PrintTranscoder()
     Constructs a new transcoder that prints images.

Method Summary
public static  voidhandleValueError(String property, String value)
    
public static  voidmain(String[] args)
    
public  voidprint()
    
public  intprint(Graphics _g, PageFormat pageFormat, int pageIndex)
    
protected  voidsetImageSize(float docWidth, float docHeight)
     Sets document size according to the hints.
public static  voidsetTranscoderBooleanHint(Transcoder transcoder, String property, TranscodingHints.Key key)
    
public static  voidsetTranscoderFloatHint(Transcoder transcoder, String property, TranscodingHints.Key key)
    
public static  voidsetTranscoderRectangleHint(Transcoder transcoder, String property, TranscodingHints.Key key)
    
public static  voidsetTranscoderStringHint(Transcoder transcoder, String property, TranscodingHints.Key key)
    
public  voidtranscode(TranscoderInput in, TranscoderOutput out)
    
protected  voidtranscode(Document document, String uri, TranscoderOutput output)
     Transcodes the specified Document as an image in the specified output.

Field Detail
KEY_AOI_STR
final public static String KEY_AOI_STR(Code)



KEY_HEIGHT_STR
final public static String KEY_HEIGHT_STR(Code)



KEY_LANGUAGE_STR
final public static String KEY_LANGUAGE_STR(Code)



KEY_MARGIN_BOTTOM
final public static TranscodingHints.Key KEY_MARGIN_BOTTOM(Code)
The marginBottom key.

Key:

KEY_MARGIN_BOTTOM

Value:

Length

Default:

None

Required:

No

Description:

The print page bottom margin



KEY_MARGIN_BOTTOM_STR
final public static String KEY_MARGIN_BOTTOM_STR(Code)



KEY_MARGIN_LEFT
final public static TranscodingHints.Key KEY_MARGIN_LEFT(Code)
The marginLeft key.

Key:

KEY_MARGIN_LEFT

Value:

Length

Default:

None

Required:

No

Description:

The print page left margin



KEY_MARGIN_LEFT_STR
final public static String KEY_MARGIN_LEFT_STR(Code)



KEY_MARGIN_RIGHT
final public static TranscodingHints.Key KEY_MARGIN_RIGHT(Code)
The marginRight key.

Key:

KEY_MARGIN_RIGHT

Value:

Length

Default:

None

Required:

No

Description:

The print page right margin



KEY_MARGIN_RIGHT_STR
final public static String KEY_MARGIN_RIGHT_STR(Code)



KEY_MARGIN_TOP
final public static TranscodingHints.Key KEY_MARGIN_TOP(Code)
The marginTop key.

Key:

KEY_MARGIN_TOP

Value:

Length

Default:

None

Required:

No

Description:

The print page top margin



KEY_MARGIN_TOP_STR
final public static String KEY_MARGIN_TOP_STR(Code)



KEY_PAGE_HEIGHT
final public static TranscodingHints.Key KEY_PAGE_HEIGHT(Code)
The pageHeight key.

Key:

KEY_PAGE_HEIGHT

Value:

Length

Default:

None

Required:

No

Description:

The height of the print page



KEY_PAGE_HEIGHT_STR
final public static String KEY_PAGE_HEIGHT_STR(Code)



KEY_PAGE_ORIENTATION
final public static TranscodingHints.Key KEY_PAGE_ORIENTATION(Code)
The pageOrientation key.

Key:

KEY_PAGE_ORIENTATION

Value:

String

Default:

VALUE_PAGE_ORIENTATION_PORTRAIT

Required:

No

Description:

The print page's orientation



KEY_PAGE_ORIENTATION_STR
final public static String KEY_PAGE_ORIENTATION_STR(Code)



KEY_PAGE_WIDTH
final public static TranscodingHints.Key KEY_PAGE_WIDTH(Code)
The pageWidth key.

Key:

KEY_PAGE_WIDTH

Value:

Length

Default:

None

Required:

No

Description:

The width of the print page



KEY_PAGE_WIDTH_STR
final public static String KEY_PAGE_WIDTH_STR(Code)



KEY_PIXEL_TO_MM_STR
final public static String KEY_PIXEL_TO_MM_STR(Code)



KEY_SCALE_TO_PAGE
final public static TranscodingHints.Key KEY_SCALE_TO_PAGE(Code)
The scaleToPage key.

Key:

KEY_SCALE_TO_PAGE

Value:

Boolean

Default:

true

Required:

No

Description:

Specifies whether or not the SVG images are scaled to fit into the printed page



KEY_SCALE_TO_PAGE_STR
final public static String KEY_SCALE_TO_PAGE_STR(Code)



KEY_SHOW_PAGE_DIALOG
final public static TranscodingHints.Key KEY_SHOW_PAGE_DIALOG(Code)
The showPageDialog key.

Key:

KEY_SHOW_PAGE_DIALOG

Value:

Boolean

Default:

false

Required:

No

Description:

Specifies whether or not the transcoder should pop up a dialog box for selecting the page format.



KEY_SHOW_PAGE_DIALOG_STR
final public static String KEY_SHOW_PAGE_DIALOG_STR(Code)



KEY_SHOW_PRINTER_DIALOG
final public static TranscodingHints.Key KEY_SHOW_PRINTER_DIALOG(Code)
The showPrinterDialog key.

Key:

KEY_SHOW_PAGE_DIALOG

Value:

Boolean

Default:

false

Required:

No

Description:

Specifies whether or not the transcoder should pop up a dialog box for selecting the printer. If the dialog box is not shown, the transcoder will use the default printer.



KEY_SHOW_PRINTER_DIALOG_STR
final public static String KEY_SHOW_PRINTER_DIALOG_STR(Code)



KEY_USER_STYLESHEET_URI_STR
final public static String KEY_USER_STYLESHEET_URI_STR(Code)



KEY_WIDTH_STR
final public static String KEY_WIDTH_STR(Code)



KEY_XML_PARSER_CLASSNAME_STR
final public static String KEY_XML_PARSER_CLASSNAME_STR(Code)



USAGE
final public static String USAGE(Code)



VALUE_MEDIA_PRINT
final public static String VALUE_MEDIA_PRINT(Code)



VALUE_PAGE_ORIENTATION_LANDSCAPE
final public static String VALUE_PAGE_ORIENTATION_LANDSCAPE(Code)



VALUE_PAGE_ORIENTATION_PORTRAIT
final public static String VALUE_PAGE_ORIENTATION_PORTRAIT(Code)



VALUE_PAGE_ORIENTATION_REVERSE_LANDSCAPE
final public static String VALUE_PAGE_ORIENTATION_REVERSE_LANDSCAPE(Code)




Constructor Detail
PrintTranscoder
public PrintTranscoder()(Code)
Constructs a new transcoder that prints images.




Method Detail
handleValueError
public static void handleValueError(String property, String value)(Code)



main
public static void main(String[] args) throws Exception(Code)



print
public void print() throws PrinterException(Code)
Convenience method



print
public int print(Graphics _g, PageFormat pageFormat, int pageIndex)(Code)
Printable implementation



setImageSize
protected void setImageSize(float docWidth, float docHeight)(Code)
Sets document size according to the hints. Global variables width and height are modified.
Parameters:
  docWidth - Width of the document.
Parameters:
  docHeight - Height of the document.



setTranscoderBooleanHint
public static void setTranscoderBooleanHint(Transcoder transcoder, String property, TranscodingHints.Key key)(Code)



setTranscoderFloatHint
public static void setTranscoderFloatHint(Transcoder transcoder, String property, TranscodingHints.Key key)(Code)



setTranscoderRectangleHint
public static void setTranscoderRectangleHint(Transcoder transcoder, String property, TranscodingHints.Key key)(Code)



setTranscoderStringHint
public static void setTranscoderStringHint(Transcoder transcoder, String property, TranscodingHints.Key key)(Code)



transcode
public void transcode(TranscoderInput in, TranscoderOutput out)(Code)



transcode
protected void transcode(Document document, String uri, TranscoderOutput output) throws TranscoderException(Code)
Transcodes the specified Document as an image in the specified output.
Parameters:
  document - the document to transcode
Parameters:
  uri - the uri of the document or null if any
Parameters:
  output - the ouput where to transcode
exception:
  TranscoderException - if an error occured while transcoding



Fields inherited from org.apache.batik.transcoder.SVGAbstractTranscoder
final public static String DEFAULT_ALLOWED_SCRIPT_TYPES(Code)(Java Doc)
final public static String DEFAULT_DEFAULT_FONT_FAMILY(Code)(Java Doc)
final public static TranscodingHints.Key KEY_ALLOWED_SCRIPT_TYPES(Code)(Java Doc)
final public static TranscodingHints.Key KEY_ALTERNATE_STYLESHEET(Code)(Java Doc)
final public static TranscodingHints.Key KEY_AOI(Code)(Java Doc)
final public static TranscodingHints.Key KEY_CONSTRAIN_SCRIPT_ORIGIN(Code)(Java Doc)
final public static TranscodingHints.Key KEY_DEFAULT_FONT_FAMILY(Code)(Java Doc)
final public static TranscodingHints.Key KEY_EXECUTE_ONLOAD(Code)(Java Doc)
final public static TranscodingHints.Key KEY_HEIGHT(Code)(Java Doc)
final public static TranscodingHints.Key KEY_LANGUAGE(Code)(Java Doc)
final public static TranscodingHints.Key KEY_MAX_HEIGHT(Code)(Java Doc)
final public static TranscodingHints.Key KEY_MAX_WIDTH(Code)(Java Doc)
final public static TranscodingHints.Key KEY_MEDIA(Code)(Java Doc)
final public static TranscodingHints.Key KEY_PIXEL_TO_MM(Code)(Java Doc)
final public static TranscodingHints.Key KEY_PIXEL_UNIT_TO_MILLIMETER(Code)(Java Doc)
final public static TranscodingHints.Key KEY_SNAPSHOT_TIME(Code)(Java Doc)
final public static TranscodingHints.Key KEY_USER_STYLESHEET_URI(Code)(Java Doc)
final public static TranscodingHints.Key KEY_WIDTH(Code)(Java Doc)
protected GVTBuilder builder(Code)(Java Doc)
protected BridgeContext ctx(Code)(Java Doc)
protected Rectangle2D curAOI(Code)(Java Doc)
protected AffineTransform curTxf(Code)(Java Doc)
protected GraphicsNode root(Code)(Java Doc)
protected UserAgent userAgent(Code)(Java Doc)
protected float widthheight(Code)(Java Doc)

Methods inherited from org.apache.batik.transcoder.SVGAbstractTranscoder
protected BridgeContext createBridgeContext(SVGOMDocument doc)(Code)(Java Doc)
protected BridgeContext createBridgeContext()(Code)(Java Doc)
protected DocumentFactory createDocumentFactory(DOMImplementation domImpl, String parserClassname)(Code)(Java Doc)
protected UserAgent createUserAgent()(Code)(Java Doc)
protected CanvasGraphicsNode getCanvasGraphicsNode(GraphicsNode gn)(Code)(Java Doc)
protected void setImageSize(float docWidth, float docHeight)(Code)(Java Doc)
public void transcode(TranscoderInput input, TranscoderOutput output) throws TranscoderException(Code)(Java Doc)
protected void transcode(Document document, String uri, TranscoderOutput output) throws TranscoderException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.