Introduction To PDF Programming: Leonard Rosenthol Lazerware
Introduction To PDF Programming: Leonard Rosenthol Lazerware
Programming
Leonard Rosenthol
Lazerware
Overview
What might you want to do with PDF?
Review of available libraries
Review of the PDF file format
Developing with the Acrobat API
Developing with PDFlib
How I do things
You should all have copies of the presentation
that you received when you walked in.
There is also an electronic copy of this
presentation (PDF format, of course!) on my
website at http://www.lazerware.com/
Ive left time at the end for Q&A, but please
feel free to ask questions at any time!
Creation
Report generation
Content repurposing
Document Conversion
Manipulation
Imaging
Printing
Rasterization (conversion to bitmap)
Content extraction/conversion
Text, HTML, XML
Postscript
Review of Libraries
Creation Only
PDFlib
ClibPDF (FastIO)
Panda (StillHQ)
PDF File Creator (FyTek)
PDF in a Box (Synactis)
PDFever (Perl Script Studio)
SanFace PDFLibrary (SanFace)
ReportLab
Libraries (cont)
Creation Only
PDFLibrary (Glance)
Life*JOVE (Corena)
PJ (Etymon)
activePDF Toolkit (ActivePDF)
Libraries (cont)
Imaging
5D PDFLibrary (Global Graphics)
Ghostscript (Artifex)
Everything
Acrobat SDK
Adobe PDFLibrary
DocuCom PDF Core Library (Zeon)
SPDF (Appligent)
Whats in a PDF?
PDF file
other data
Header
Body
Sequence of objects
XREF
Trailer
Structure of a PDF
document
Imagable
Content
Thumbnail
Outline entry
1
...
Outline entry
n
Thread 1
Bead 1
...
Page 1
Pages tree
Annotations
...
Page n
Outline tree
Catalog
Article
threads
...
Thread n
Named
destinations
AcroForm
Bead n
Smallest PDF
%PDF-1.1
xref
1 0 obj
0 5
<<
0000000000 65535 f
/Pages 3 0 R
0000000015 00000 n
/Type /Catalog
0000000085 00000 n
>>
0000000136 00000 n
endobj
0000000227 00000 n
2 0 obj
trailer
<<
<<
/Type /Page
/Size 5
/Parent 3 0 R
/Root 1 0 R
>>
/ID[<5181383ede94727bcb32ac27ded71c68><5181383ede94727bcb32ac27ded71c68>]
endobj
3 0 obj
>>
<<
startxref
/Kids [ 2 0 R ]
277
/Count 1
%%EOF
/Type /Pages
/MediaBox [ 0 0 612 792 ]
>>
endobj
Acrobat Plugins
Adobe PDFLibrary
SPDF (Appligent)
Windows
Whats in there?
Content extraction
PDF rendering
Printing
Everything is an object
CosObj
PDDoc
AVDoc
PDEObject
PDF Objects
ASAtoms
ASAtomFromString()
ASAtomGetString()
ASAtomExistsForString()
ASFileSys
ASPathName
Error Handling
DURING/HANDLER/ENDHANDLER
CosNull != NULL
Thread Safety?
freed
leaked
Array
17
17
16
HashTable
HashtableEntriesTable
ASAtom
145
145
124
ASFile
CosArray
CosBoolean
CosDict
CosDoc
CosDocRevision
CosName
23
23
23
CosNull
CosNumber
LZWFilter
FlateFilter
PDBookmark
PDBead
PDDoc
PDPage
PDPath
PDFileSpec
PDFont
PDFlib
Whats in there?
PDF Creation/Generation
Everything is a PDF?
PDF *p = PDF_new();
Error Handling
Hello (PDFlib)
Q&A