require PDF
true
PDF.parse_str("%Hello, PDF !\n")
void
PDF.parse_str("123\n")
123
PDF.parse_str("(abc)\n")
"abc"
PDF.parse_str("(ab(())c)\n")
"ab(())c"
PDF.parse_str("<41424344>\n")
"ABCD"
PDF.parse_str("/name\n")
:name
PDF.parse_str("[]\n")
[]
PDF.parse_str("[/section]\n")
[:section]
PDF.parse_str("[123]\n")
[123]
PDF.parse_str("[<4142>]\n")
["AB"]
PDF.parse_str("[(greet(name))]\n")
["greet(name)"]
PDF.parse_str("[/section 123 <4142> (greet(name))]\n")
[:section, 123, "AB", "greet(name)"]
PDF.parse_str("<< /Type /Example >>\n")
%{Type: Example}
PDF.parse_str("<< /Type /Example\n /Sub << /Type /SubExample >> >>\n")
%{Sub: %{Type: SubExample},
Type: Example}
PDF.parse_str("1 0 obj (Test) endobj\n")
{:indirect_object, 1, 0, "Test"}
PDF.parse_str("1 0 R\n")
{:indirect_object, 1, 0}
PDF.parse_str("null\n")
void
PDF.parse_str("+3\n")
3
PDF.parse_str("3\n")
3
PDF.parse_str("-3\n")
-3
PDF.parse_str("<< /Length 3 >>\n")
%{Length: 3}
PDF.parse_str("1 0 obj << /Length 3 >> stream\n123\nendstream\n")
{:indirect_object, 1, 0, %PDF.Stream{dictionnary: %{Length: 3},
offset: (S64) 31,
length: (S64) 0}}
PDF.parse_str("1 0 obj << /Length 2 0 R >> stream\n123\nendstream\n")
{:indirect_object, 1, 0, %PDF.Stream{dictionnary: %{Length: {:indirect_object, 2, 0}},
offset: (S64) 35,
length: (S64) 0}}
PDF.parse_str("<</Size 333187>>\n")
%{Size: 333187}
PDF.parse_file("pdf.pdf")
%PDF.File{trailer: %PDF.Trailer{dictionnary: %{Size: 333187},
startxref: (U64) 129},
header: "%PDF-1.4",
body: void,
xref: %{}}
PDF.parse_file("pdf.ekc3.pdf")
%PDF.File{trailer: %PDF.Trailer{dictionnary: %{DocChecksum: :7AB514FD25E9BF8F2F6AB53FC511363A,
ID: ["\xC4\xFC\xA2̬\xB3\x9C\xD4\xCB\xF5P\x10A\x06S", "\xC4\xFC\xA2̬\xB3\x9C\xD4\xCB\xF5P\x10A\x06S"],
Info: {:indirect_object, 319, 0},
Root: {:indirect_object, 318, 0},
Size: 320},
startxref: (U64) 59446},
header: "%PDF-1.7",
body: void,
xref: %{}}