You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

renderers.xml 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?xml version="1.0" standalone="no"?>
  2. <!-- Overview -->
  3. <document>
  4. <header>
  5. <title>Renderers</title>
  6. <subtitle>All you wanted to know about the Renderers !</subtitle>
  7. <authors> <person name="Keiron Liddle" email="keiron@aftexsw.com"/>
  8. </authors>
  9. </header>
  10. <body><s1 title="Renderers">
  11. <s2 title="Renderers">
  12. <p>A renderer is used to convert the Area Tree into the output document.
  13. The renderer is given the tree one page at a time. All pages are supplied
  14. in the order they appear in the document. In order to save memory it is
  15. possble to render the pages out of order. Any page that is not reeady to
  16. be rendered is setup by the renderer first so that it can reserve a space
  17. or reference for when the page is ready to be rendered.</p>
  18. <p>The AbstractRenderer does most of the work to iterate through the area
  19. tree parts. This means that the most renderers simply need to implement
  20. the specific parts with inserting text, images and lines. The methods can
  21. easily be overridden to handle things in a different way or do some extra
  22. processing.</p></s2>
  23. <s2 title="Fonts">
  24. <p>The fonts are setup by the renderer being used. The font metrics are used
  25. during the layout process to determine the size of characters.</p>
  26. </s2>
  27. <s2 title="Render Context">
  28. <p>The render context is used by handlers. It contains information about the
  29. current state of the renderer. Such as the page, the position and any
  30. other miscellanous objects that are required to draw into the page.</p></s2>
  31. <s2 title="XML Handling">
  32. <p>A document may contain information in the form of XML for an image or
  33. instream foreign object. This XML is handled
  34. through the user agent. A standard extension for PDF is the SVG handler.</p><p>
  35. If there is XML in the SVG namespace it is given to the handler which
  36. renders the SVG into the pdf document at the given location.
  37. This separation means that other XML handlers can easily be added.</p></s2>
  38. <s2 title="Extensions">
  39. <p>Document level extensions are handled with an extension handler. This
  40. handles the information from the AreaTree and adds renders it to the
  41. document. An example is the pdf bookmarks. This information first needs to
  42. have all references resolved. Then the extension handler is ready to put
  43. the information into the pdf document.</p></s2>
  44. <s2 title="Types">
  45. <s3 title="PDF">
  46. <p>This uses the PDFDocument classes to create a PDF document. This supports
  47. out of order rendering as it is possible to reserve a pdf page object that
  48. can be later filled. Most of the work is to insert text or create lines.
  49. SVG is handled by the XML handler that uses the PDFGraphics2D and batik to
  50. draw the svg into the pdf page.</p><p>
  51. This also allows for font embedding.</p>
  52. </s3>
  53. <s3 title="SVG">
  54. <p>This creates a single svg document that contains all the pages rendered
  55. with page sequences horizontally and pages vertically. This also adds
  56. links between the pages so that it can be viewed by clicking on the page
  57. to go to the next page.</p></s3>
  58. <s3 title="TXT">
  59. <p>This simply outputs to a text document.</p></s3>
  60. <s3 title="AWT">
  61. <p>This draws the pages into an AWT graphic.</p></s3>
  62. <s3 title="PS and PCL">
  63. <p>Similar to PDF.</p></s3>
  64. <s3 title="XML">
  65. <p>Creates an XML file that represents the AreaTree.</p>
  66. </s3>
  67. <s3 title="Print">
  68. <p>This prints the document using the java printing facitlities. The AWT
  69. rendering is used to draw the pages onto the printjob.
  70. </p></s3>
  71. <s3 title="RTF and MIF">
  72. <p>These formats do not use this rendering mechanism.</p></s3>
  73. </s2>
  74. <s2 title="Adding a Renderer">
  75. <p>It is also possible to add other renderers. The renderer simply needs to
  76. implement the Renderer interface. The AbstractRenderer does most of what
  77. is needed so it is better to extend this. This means that you only need to
  78. implement the basic functionality such as text and lines.
  79. </p></s2>
  80. <s2 title="Multiple Renderers">
  81. <p>The layout of the document depends mainly on the font being used.
  82. If two renderers have the same font metrics then it is possible to render
  83. the Area Tree in each renderer. This can be handled by the AreaTree
  84. Handler.</p></s2>
  85. <s2 title="Associated Tasks">
  86. <ul><li>Sort out multiple renderers concept.</li></ul>
  87. </s2>
  88. </s1>
  89. </body></document>