-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File size gets increased or unchanged #262
Comments
This sounds realistic if the pages that you removed were only text and the remaining pages contain images. Then, lopdf is not at fault. If that is not the case, a PDF file to reproduce this issue would be very helpful. |
lopdf is awesome, thank you for this crate. 1: https://gitlab.com/andrew_ryan/pdf_cli/-/blob/main/src/main.rs?ref_type=heads#L107 |
Hi . All the pages which I removed contains images. |
Thanks, I'll have a look at it, but probably not very soon. |
I had a PDF fie with 58 pages of size 4.5 MB , I removed 50 pages from the file the size was like 4.4 MB for 8 pages, I did use compress and other things but he size remained unchanged.
use lopdf::dictionary;
use std::collections::BTreeMap;
use std::vec;
use lopdf::content::{Content, Operation};
use lopdf::{Bookmark, Document, Object, ObjectId, Stream};
fn main() {
let mut doc = Document::load("PATH_TO_58_page.pdf").unwrap();
doc.compress();
let count = doc.get_pages().len();
}
The text was updated successfully, but these errors were encountered: