commit 83202070c7a2025e7bbafb4f244a4ab7019b6e3e Author: IllusionMan1212 Date: Sun Oct 11 16:33:19 2026 +0200 initial commit diff --git a/example/main.odin b/example/main.odin new file mode 100644 index 0000000..8bcfea4 --- /dev/null +++ b/example/main.odin @@ -0,0 +1,7 @@ +package pdf_example + +import pdf "../" + +main :: proc() { + pdf.open_file("example.pdf") +} diff --git a/pdf.odin b/pdf.odin new file mode 100644 index 0000000..d25478e --- /dev/null +++ b/pdf.odin @@ -0,0 +1,27 @@ +package pdf + +import "core:os" + +Error :: enum { + File_Read_Error, +} + +Document :: struct { +} + +open :: proc{ + open_file, + open_bytes, +} + +open_file :: proc(path: string) -> (pdf: ^Document, err: Error) { + data, read_err := os.read_entire_file(path, context.allocator) + if read_err != nil { + return nil, .File_Read_Error + } + + return open_bytes(data) +} + +open_bytes :: proc(data: []u8) -> (pdf: ^Document, err: Error) { +} diff --git a/testdata/Get_Started_With_Smallpdf.pdf b/testdata/Get_Started_With_Smallpdf.pdf new file mode 100644 index 0000000..9916f54 Binary files /dev/null and b/testdata/Get_Started_With_Smallpdf.pdf differ diff --git a/testdata/pdf-sample_0.pdf b/testdata/pdf-sample_0.pdf new file mode 100644 index 0000000..774c2ea Binary files /dev/null and b/testdata/pdf-sample_0.pdf differ