#include #include #include #include "../../crates/pdftract-libpdftract/include/pdftract.h" int main(void) { const char *pdf_path = "/tmp/test.pdf"; // Create minimal PDF const char *pdf_data = "%PDF-1.4\n" "1 0 obj<>endobj\n" "2 0 obj<>endobj\n" "3 0 obj<>>>>>>>>>endobj\n" "xref\n" "0 4\n" "0000000000 65535 f\n" "0000000009 00000 n\n" "0000000052 00000 n\n" "0000000109 00000 n\n" "trailer<>\n" "startxref\n" "206\n" "%%EOF\n"; FILE *f = fopen(pdf_path, "w"); fwrite(pdf_data, 1, strlen(pdf_data), f); fclose(f); // Test hash function char *result = pdftract_hash(pdf_path); if (result) { printf("Hash result: %s\n", result); pdftract_free(result); } else { printf("Hash returned null\n"); } // Test extract function result = pdftract_extract(pdf_path, "{}"); if (result) { printf("Extract result (first 500 chars): %.500s...\n", result); pdftract_free(result); } else { printf("Extract returned null\n"); } return 0; }