Invalid cross-reference table (could not parse xref)
pheianox opened this issue · comments
Pheianox commented
fn shrink_file(path: &str) {
let doc = Document::load(path);
match doc {
Ok(mut pdf) => {
pdf.compress();
pdf.save(format!("{path}__compressed")).unwrap();
},
Err(error) => {
panic!("error {}", error.to_string())
}
};
}
Output
thread 'main' panicked at 'error Invalid cross-reference table (could not parse xref)', src/main.rs:36:7
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
ELIFECYCLE Command failed.
ELIFECYCLE Command failed with exit code 101.
Deleted user commented
What's the problem?
Ahmed Alaa commented
can you provide the pdf you tried to open so that we can examine it.
Deleted user commented
can you provide the pdf you tried to open so that we can examine it.
The file is gone :(
Maybe problem was that I created it in Figma... idk