| <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <!-- $Id$ --> |
| <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "http://forrest.apache.org/dtd/document-v13.dtd"> |
| |
| <document> |
| <header> |
| <title>Apache™ FOP Design: PDF Library</title> |
| <version>$Revision$</version> |
| </header> |
| |
| <body> |
| <section id="intro"> |
| <title>Introduction</title> |
| |
| <p>The PDF Library is an independant package of classes in Apache™ FOP. These class |
| provide a simple way to construct documents and add the contents. The |
| classes are found in <code>org.apache.fop.pdf.*</code>.</p> |
| </section> |
| |
| <section> |
| <title>PDF Document</title> |
| <p>This is where most of the document is created and put together.</p> |
| <p>It sets up the header, trailer and resources. Each page is made and added to the document. |
| There are a number of methods that can be used to create/add certain PDF objects to the document.</p> |
| </section> |
| |
| <section> |
| <title>Building PDF</title> |
| <p>The PDF Document is built by creating a page for each page in the Area Tree.</p> |
| <p> This page then has all the contents added. |
| The page is then added to the document and available objects can be written to the output stream.</p> |
| <p>The contents of the page are things such as text, lines, images etc. |
| The PDFRenderer inserts the text directly into a pdf stream. |
| The text consists of markup to set fonts, set text position and add text.</p> |
| <p>Most of the simple pdf markup is inserted directly into a pdf stream. |
| Other more complex objects or commonly used objects are added through java classes. |
| Some pdf objects such as an image consists of two parts.</p> |
| <p>It has a separate object for the image data and another bit of markup to display the image in a certain position on the page. |
| </p><p>The java objects that represent a pdf object implement a method that returns the markup for inserting into a stream. |
| The method is: byte[] toPDF().</p> |
| |
| </section> |
| <section> |
| <title>Features</title> |
| |
| <section> |
| <title>Fonts</title> |
| <p>Support for embedding fonts and using the default Acrobat fonts. |
| </p></section> |
| |
| <section> |
| <title>Images</title> |
| <p>Images can be inserted into a page. The image can either be inserted as a pixel map or directly insert a jpeg image. |
| </p></section> |
| |
| <section> |
| <title>Stream Filters</title> |
| <p>A number of filters are available to encode the pdf streams. These filters can compress the data or change it such as converting to hex. |
| </p></section> |
| |
| <section> |
| <title>Links</title> |
| <p>A pdf link can be added for an area on the page. This link can then point to an external destination or a position on any page in the document. |
| </p></section> |
| |
| <section> |
| <title>Patterns</title> |
| <p>The fill and stroke of graphical objects can be set with a colour, pattern or gradient. |
| </p></section> |
| |
| <p>The are a number of other features for handling pdf markup relevent to creating PDF files for FOP.</p> |
| </section> |
| |
| </body> |
| </document> |