pdftract/tests/debug_stream.c
jedarden 9b5fbc9b5e feat(pdftract-bf-2y2rp): implement lazy stream decoding for PDF extraction
- Add decode_page_content_streams() function for per-page lazy decode
- Update extract_page_from_dict() to support lazy stream decoding
- Modify extract_pdf() and extract_pdf_ndjson() to enable lazy decoding
- Fix borrow checker issue in LazyPageIter::next()

This ensures content streams are decoded lazily per page and dropped
immediately after processing, keeping peak RSS flat across page count.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 12:30:26 -04:00

21 lines
574 B
C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../crates/pdftract-libpdftract/include/pdftract.h"
int main(void) {
printf("Testing pdftract_extract_stream_open...\n");
void* handle = pdftract_extract_stream_open("/tmp/test.pdf", "{}");
printf("Handle: %p\n", handle);
if (handle == NULL) {
const char* error = pdftract_last_error();
printf("Error: %s\n", error ? error : "(null)");
} else {
printf("Stream opened successfully\n");
pdftract_stream_close(handle);
}
return 0;
}