FOP: A Formatting Object to PDF Translator - PowerPoint PPT Presentation

About This Presentation
Title:

FOP: A Formatting Object to PDF Translator

Description:

whole thing took two weeks (mostly spent designing font) ... colour, borders, backgrounds. Better interfacing. generic SAX parser, DOM support. Better layout ... – PowerPoint PPT presentation

Number of Views:56
Avg rating:3.0/5.0
Slides: 19
Provided by: jamest52
Category:

less

Transcript and Presenter's Notes

Title: FOP: A Formatting Object to PDF Translator


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
Areas Spaces
10
Flow Objects with Properties
ltblock text-align"start" space-before.optimum"
12pt" font-size"11pt" line-height"12pt"gtThis
is an example of FOPlt/blockgt
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 ltlt /Type /Info /Producer (FOP 0.6.0) gtgt
endobj 4 0 obj ltlt /Type /Font /Name /F6
/Encoding /AdobeStandardEncoding /BaseFont
/Times-Italic /Subtype /Type1 gtgt endobj 16 0
obj ltlt /Type /Pages /Count 3 /Kids 18 0 R 20 0
R 22 0 R /MediaBox 0 0 576 792 gtgt
endobj 20 0 obj ltlt /Type /Page /Resources 3 0 R
/Contents 19 0 R /Parent 16 0 R gtgt endobj
14
PDF Example (cont'd)
17 0 obj ltlt /Length 8458 gtgt stream BT 100 667 Td
/F3 24 Tf 0 -24 Td (Examples) Tj /F1 11 Tf 0 -12
Td ET endstream endobject
15
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_at_jtauber.com
Write a Comment
User Comments (0)
About PowerShow.com