ITADN

Add Page.get_drawings() helper

#184OpenTobiasGrothmann 创建于 2025-12-28
T
TobiasGrothmanncommented
I'm currently struggling to detect two things. One is rectangles: <img width="438" height="160" alt="Image" src="https://github.com/user-attachments/assets/4f003947-af77-4786-8323-ca1126093dfa" /> and the other is highlighted text: <img width="322" height="71" alt="Image" src="https://github.com/user-attachments/assets/519da952-00db-49bf-b30c-3f404f58ec94" /> I managed to iterate text and images, but the rectangles I drew with macos' Preview are not among those. ----- Current code: ```rs let mut doc = PdfDocument::open(path)?; let text_page = page.to_text_page(TextPageOptions::PRESERVE_IMAGES)?; for block in text_page.blocks() { if let Some(image) = block.image() { println!("found image") } let block_type = block.r#type(); println!("block type: {:?}", block_type); ... ``` Could you point me in the right direction?
6 条评论