[Home]WritingPdfFiles

PdfParserProject | RecentChanges | Preferences

 I downloaded a copy of the 'jPDF1.1.1' sources and looked through the source
 for their stuff..  I'd be very surprised if the java version wasn't ported
 from smalltalk.

Anyway, it's kind of similar with different names- instead of PdfReference?, they have PdfObjectId? objects, etc.. basically every object knows how to write itself out like this:

writeCrossReferenceEntryOn?(PdfWriter? writer)

so each object has some 'write' method which takes a writer object as argument. Very similar to how 'printString' / 'onStream:' messages do it.

The 'PDFWriter' class they use is pretty straightforward- since each object knows how to print itself out, the only public methods in the writer are things like:

write(String aString) newLine()

Everything else is creation specific, like "newPage()".. we're not creating new pages or anything, so while a lot of their code doesn't really help, I feel reassured that it uses the same concept (i.e., each object should know how to print itself out as a string- the writer should be something which is instantiated with some output stream & prints things out to it) [From email, 11/27/00] -- Ivan


Thanks, that is reassuring. It occurred to me reading this that we don't know how to represent newlines as we write out. Does the PDF Reference address this? (I haven't done the reading yet.) It's as if we need a static/global that says the type of newline this file used (cr, lf, or crlf), in order to write it out exactly. -- Patty
A belated update - Adobe reader seems to only care about line feeds, so we converted all carriage returns in our write code to line feeds. -- Patty
PdfParserProject | RecentChanges | Preferences
This page is read-only (last edited December 14, 2000 9:24 pm (diff))
Search: