The extract_markdown stub was calling extract_text instead of extract_text_fn, causing a compilation error. This fixes the function name to match the exported function from extract_text.rs. This completes the extract_text PyO3 entry point implementation, which was already present in extract_text.rs and lib.rs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
14 lines
497 B
Rust
14 lines
497 B
Rust
use pdftract_core::audit::{AuditLogWriter, AuditRecord};
|
|
use tempfile::tempdir;
|
|
|
|
fn main() {
|
|
let temp_dir = tempdir().unwrap();
|
|
let temp_file = temp_dir.path().join("audit.ndjson");
|
|
|
|
let writer = AuditLogWriter::open(&temp_file).unwrap();
|
|
let record = AuditRecord::new("extract", Some("pdftract-v1:abcd".to_string()), 1234, 200);
|
|
writer.write_record(&record).unwrap();
|
|
|
|
let contents = std::fs::read_to_string(&temp_file).unwrap();
|
|
println!("Output: {:?}", contents);
|
|
}
|