PDF in Y minutes
2024-02-23

Non-functional Draft
A terse guide to writing pdf files by hand (pdf is a textual format).
Not specification compliant: no xref table for random access, no explicit type definitions, no size declarations.
Those formalities aren't required for modern pdf viewers and are annoying to write by hand.
Similar to Learn X in Y minutes: a tutorial in the style of an example file.

%PDF-1.4 % ^ Header is required, can be %PDF-1.4, %PDF-1.0, etc. % percent sign is a comment if you didn't realise % pdf is a subset of the turing complete postscript language % it has primitive datatypes like numbers and strings % as well as complex datatypes like arrays and dictionaries % fun little comment haha (My test string) <DEADBEEF> [/TestName 1.3 -1.2 (Test array)] % dictionary keys must be a name % a name starts with a slash and is a unique, indivisible key % ie. you cannot split a name into letter characters << /Foo 3 /Bar 1 /Baz 2 /SubDict << /Lol (cows) /Meme 123 /Hi (mom) >> >> % object of reference number 1 and generation number 0 % reference number is like a pointer address % generation number is the edit version of an object 1 0 obj (Meme) endobj % first value is the reference to object 1 0 % the R means the numbers are a reference value [1 0 R 1.3 (Meme2)] % tutorial is unfinished. todo: finish tutorial % end of file marker is required %%EOF
wip