1 / 18

FOP: A Formatting Object to PDF Translator

FOP: A Formatting Object to PDF Translator. James Tauber http://www.jtauber.com/fop/. Outline. Pre-history and History Overview of XSL Overview of PDF Architecture Demo Future Plans. Before FOP. 1994: Self-published Index to the Greek New Testament

Download Presentation

FOP: A Formatting Object to PDF Translator

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. FOP: A Formatting Object to PDF Translator James Tauber http://www.jtauber.com/fop/

  2. Outline • Pre-history and History • Overview of XSL • Overview of PDF • Architecture • Demo • Future Plans

  3. Before FOP • 1994: Self-published Index to the Greek New Testament • SGML source: derived from UPenn's lemmatized UBS3 • custom C code + TeX macros + METAFONT • multilingual, multicolumn, dictionary-style headers • whole thing took two weeks (mostly spent designing font) • 1995: Learnt Perl and wrote generalized SGML to HTML and SGML to TeX routines for own use

  4. Before FOP (cont'd) • 1996: Internship at Sun Labs • goal to learn Java • and DSSSL (from draft made available by Jon Bosak) • 1996: Started designing DSSSL formatters • flow object tree to TeX for print • flow object tree to Tk for online • during email exchange with Jon about this, invited to join W3C SGML Activity

  5. The Birth of FOP • 18 August 1998 • first XSL working draft released • I decide to write a formatter that takes XSL FOs and generates PDF • download PDF spec and start writing Perl to output it • 19 August 1998 • James Clark releases first alpha of XT • 21 August 1998 • thread on XML-L leads me to mention formatter • I ask for name suggestions

  6. The Birth of FOP (cont'd) • 24 August 1998 • I announce FOP on XSL-L and xml-dev • name suggested by Chris Maden • version 0.03, written in Perl, not yet released publicly • plan to port to Java after prototyping

  7. A Brief History • Paul Prescod suggests prototyping in Python • I learn Python • Version 0.1.0: first Python version, content still hard-coded • Version 0.1.2: SAX used to read FOs as XML • Version 0.3.1: last Python version • Version 0.4.0: first Java version 30 October 1998 • loses some functionality such as page breaking • Version 0.5.1: last version for 1998 (4 November)

  8. A Brief History (cont'd) • Sun/Adobe announce prize money • FOP is only XSL formatter available • I begin radical re-write in light of December working draft • Start re-re-write in light of April working draft • Release 0.6.0 (5 May 1999)

  9. Block area Inline space Display space Inline area Line area Areas + Spaces

  10. Flow Objects with Properties <block text-align="start" space-before.optimum="12pt" font-size="11pt" line-height="12pt">This is an example of FOP…</block>

  11. Page-masters and regions

  12. PDF • Text format • Sequence of numbered objects • metadata • fonts • groups of pages • pages • streams • Cross-reference of byte offsets in table • Streams containing PDF drawing operations

  13. PDF Example 1 0 obj << /Type /Info /Producer (FOP 0.6.0) >> endobj … 4 0 obj << /Type /Font /Name /F6 /Encoding /AdobeStandardEncoding /BaseFont /Times-Italic /Subtype /Type1 >> endobj … 16 0 obj << /Type /Pages /Count 3 /Kids [ 18 0 R 20 0 R 22 0 R ] /MediaBox [ 0 0 576 792 ] >> endobj … 20 0 obj << /Type /Page /Resources 3 0 R /Contents 19 0 R /Parent 16 0 R >> endobj

  14. PDF Example (cont'd) 17 0 obj << /Length 8458 >> stream BT 100 667 Td /F3 24 Tf 0 -24 Td (Examples) Tj /F1 11 Tf 0 -12 Td … ET endstream endobject

  15. XT FOP Acrobat Reader Layers XML Formatting Objects Formatting Objects(with fully computed properties) Areas + Spaces PDF Pixels on ScreenInk on Page

  16. FOP Packages • com.jtauber.fop • com.jtauber.fop.fo • com.jtauber.fop.fo.properties • com.jtauber.fop.layout • com.jtauber.fop.fontmetrics • com.jtauber.pdf

  17. What's Next • Increase flow object support • lists, rules, etc • Increase property support • colour, borders, backgrounds • Better interfacing • generic SAX parser, DOM support • Better layout • keeps, vertical justification, columns, out-of-line formatting objects, hyphenation, i18n

  18. What you can do • Download an XSLT processor • Download FOP • http://www.jtauber.com/fop/ • Use them to learn XSL • Let me know what you need FOP to be able to do! • jtauber@jtauber.com

More Related