summaryrefslogtreecommitdiff
path: root/src/pdf.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-06 18:11:36 -0300
committerGabriel Schneider <[email protected]>2026-09-07 13:59:12 -0300
commit60367d8fe23f6af98ec28e3cf6c2094dfe332df0 (patch)
tree310fc734173cf771881f4691c71909135fadde97 /src/pdf.zig
parentfa82cac885cb4738fe36d1e49b4749b5a3e31a4a (diff)
downloadpardes-60367d8fe23f6af98ec28e3cf6c2094dfe332df0.tar.gz
pardes-60367d8fe23f6af98ec28e3cf6c2094dfe332df0.zip
Refactor panes and filesystem; replace FUSE with 9P
Consolidate pane, layout, memory and host code. Serve 9P by default over Unix sockets, with runtime mounts and optional TCP/QUIC transports. Remove FUSE and obsolete proof-of-concept examples. Fix highlighting and terminal-history performance, expand differential and stress-test infrastructure, sort navigation results while preserving the next occurrence, add syntax-colored Braille minimaps, remove SPC-k, and document 9P interaction as a repository skill.
Diffstat (limited to 'src/pdf.zig')
-rw-r--r--src/pdf.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pdf.zig b/src/pdf.zig
index b7e12fe8..a12be0b1 100644
--- a/src/pdf.zig
+++ b/src/pdf.zig
@@ -726,6 +726,13 @@ pub const Document = struct {
document.* = undefined;
}
+ pub fn openBytes(bytes: []const u8) !Document {
+ var page_count: c_int = 0;
+ const handle = c.pardes_pdf_open_memory(bytes.ptr, bytes.len, &page_count) orelse
+ return error.OpenFailed;
+ return .{ .handle = handle, .pages = @intCast(page_count) };
+ }
+
/// Load and flatten the PDF-native outline/bookmarks. MuPDF's temporary
/// tree and the bridge's flat view are both dropped before this returns.
pub fn outline(