Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

Merge main (afa8e184) into pr/attachments

Osvaldo Durane46cc70d73c5
diff --cc ATTRIBUTION.toml
index 26f8ad0d5,3f3791f71..557cd48c4
--- a/ATTRIBUTION.toml
+++ b/ATTRIBUTION.toml
@@@ -7,7 -7,7 +7,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Greek UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "9e75385088265a247b1cc32605e371bd713548d213959b1a65ea1613fae2935c"
-sha256 = "cefa955aa92790d6773cb1d1e15e19019b3165a00528d57d6617362e1d1988ab"
++sha256 = "f70c4f488a05d8f2a28c64be675ebca32b2fa176ee0ece9f6b24c2c3acdd4906"
# ATTRIBUTION.toml: one entry per asset (AGENTS.md §1). The source of truth for provenance and licences.
# ATTRIBUTION.md is generated from this file: `cargo xtask assets --write`. Checked by `cargo xtask assets` (part of `xtask ci`).
@@@ -30,7 -30,7 +30,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Simplified Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "76fe46b13ba959dea99b6d322ab6eb3fd37134764fe2402f1d51a90c60e31658"
-sha256 = "1de29a6cc089be31cb6206bf41e0715f8ddcf74ef887b45ccee235d743bed223"
++sha256 = "1428c7b503a32bea4057bc3b7102ad085bbaa10cca613d615a44773cc8319a91"
[[asset]]
path = "crates/ui-egui/src/i18n/zh-hant.tsv"
@@@ -41,7 -41,7 +41,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Traditional Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "e5f3b4b5c56012ea874f7fff9f36ac27200a254fcad5648e2f9912f53b47cdcb"
-sha256 = "8c6d5b1505d76bc7ba606c98660afa60b1152c5b4c2e7d345104a6ef3d280ed2"
++sha256 = "c666ee55b3f607659bf0568a24b1bb73e91a9921d67fa57ec8373955c646b413"
[[asset]]
path = "crates/ui-egui/src/i18n/cs.tsv"
@@@ -52,7 -52,7 +52,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Czech UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "c1bd574380216e321aa3c02bd550d0f3c2794d075549d90ab39fcb003bffa2a4"
-sha256 = "8a8aed18bd8fceabd1389580361ba75b0dccf141d845650a353d8dfe19c95536"
++sha256 = "69d17bd4a047410293283bb8666ac0057bf0beb9a114a36c96dc0777cd36908a"
[[asset]]
path = "crates/ui-egui/src/i18n/pt-br.tsv"
@@@ -63,7 -63,7 +63,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Brazilian Portuguese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "88e70e8eef41bafc670f0568f3d1cd72e431d25a255caba2b028b6564e9c01a0"
-sha256 = "1c197ac045810950aceb733152a296f2224f38857b1169032fdc7092ab4aa3f7"
++sha256 = "5159e087e55ecc736ad2cae70e2d4bad81cf29769158ad1c3217b2ecc1c546fc"
[[asset]]
path = "crates/ui-egui/src/i18n/es.tsv"
@@@ -74,7 -74,7 +74,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Spanish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "08ced0d9f1c33428f7198437bedc709d5ca69683013d90c8ecabf8dabca9e007"
-sha256 = "a9cf0e062b006b40f549ce2316b88d4b0196d70bd9cecd66c12d980d699bf679"
++sha256 = "93a4a0708c83e8b4064ed5fd61ef1c5dd1cb5a88b9b6de710ceaf84391838530"
[[asset]]
path = "crates/ui-egui/src/i18n/fr.tsv"
@@@ -85,7 -85,7 +85,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "French UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "4b931b6106833c549176310f9a7de240c1ed6902256942e3d333557865ba32ee"
-sha256 = "ef5c84bd13ef8318f7deab7f42136cfe3c14cbef6fd5231014b94167baaecd2a"
++sha256 = "d95ca50f0b4826eeca03c521e5e12d1f1da3c199b0eaea73ea47813346b79395"
[[asset]]
path = "crates/ui-egui/src/i18n/de.tsv"
@@@ -96,7 -96,7 +96,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "German UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "eba7fe2a7bcfa55dba79b239d431f28ddfef616977eadb1c44065ebeb0f6f6ed"
-sha256 = "be689af8bb22537879269ad9ab9bdcc4b730665cf0b27c6bf4bad560cacf3b69"
++sha256 = "1c96fdcb2f6f36234d9528574fa22469f29191a2a1e4c1989506675f00012025"
[[asset]]
path = "crates/ui-egui/src/i18n/te.tsv"
@@@ -107,7 -107,7 +107,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Telugu UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "ed46c01b4b2a45a4c5074bcf803c9bb127c7fc4e1fe1087b276f103cc6084a78"
-sha256 = "989d2e5f57cf22c21a85951835ca9fbd05e314da67eb4c17332df1f03679fa00"
++sha256 = "38c8947fd92a3a15dbe21615cf5f3648e3fffe9a9023a53e7187ab2b3f195e2a"
[[asset]]
path = "crates/ui-egui/src/i18n/it.tsv"
@@@ -118,7 -118,7 +118,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Italian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "245c7f732176cf3906ec6cec60d2f714a333ef1026c7b6a89758294e54060e42"
-sha256 = "425c42acb8d98ac31b216b13c05a285e0676318dd379dcfb9d57cc7329e9d7a5"
++sha256 = "e8607d7aca59e1d6a476c1a63264ff49cb59c0b2c674135d3f940407ed5a6060"
[[asset]]
path = "crates/ui-egui/src/i18n/pl.tsv"
@@@ -129,7 -129,7 +129,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Polish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "5706f202a6d927a5c04b210ca2461c68007b6bf5076427a46fc5a525629aa9a5"
-sha256 = "988bcf2e0322a46c0464ff7b91ab5d90193b0ea7f454812d12595eb843de6fc7"
++sha256 = "7a32f5bb815500cf27aa8c0b5ed415fc5520f384a271bfabf802b2ba77c94460"
[[asset]]
path = "crates/ui-egui/src/i18n/ru.tsv"
@@@ -140,7 -140,7 +140,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Russian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "a4504f9883161a3c38d08a87171cb4fde086af262d24b7ea3dd1fbdf0cb8b256"
-sha256 = "ebe7aa9152baff38ae7e36aeb4f6a7ed2198166ab93425a612a66d53e43cb363"
++sha256 = "36a822dae26cc50c4313a3fbddeeebc3de7de61c9fc5305ebc7084f0b0c1cb58"
[[asset]]
path = "crates/ui-egui/src/i18n/hu.tsv"
@@@ -151,7 -151,7 +151,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Hungarian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "ac3645980050cd6efb2d051fc8abb4b172b31e1e15acb264bcd5ff23a7bed87e"
-sha256 = "69d2da21949f02c3c40f71159e377eef2fdd1a87f749d6c504e1d151ef33f643"
++sha256 = "ffaca9d5258e285e495cbcfbf23f8e9b3e9001da911b2da3f926f138286154e6"
[[asset]]
path = "crates/ui-egui/src/i18n/bg.tsv"
@@@ -162,7 -162,7 +162,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Bulgarian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "56c7571b255670473afcecdb0154d6cd41110319ded188c900844dbdfa05419d"
-sha256 = "98359685aa555f391846f2259ac302ce1234c7a180fb4abe07c36e0c1c62211e"
++sha256 = "1b3c890c32480a4241cd49bb8329b3ca0f0d7769af83c20e23c9a8d6630c1fc8"
[[asset]]
path = "crates/ui-egui/src/i18n/kk.tsv"
@@@ -173,7 -173,7 +173,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Kazakh UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "fda08a6c9e33c2322272949a114a5a2806431538eb34a4a04fa3168dacb02148"
-sha256 = "9f6296d9c79c848167fc80bb4cfaacc9e60f72edb70cc1d70f7b6088ada83578"
++sha256 = "a262f11ed6f56e70752ee657a8716dd5d7d85e124944897e0aec8f3bd68e43d4"
[[asset]]
path = "crates/ui-egui/src/i18n/ja.tsv"
@@@ -184,7 -184,7 +184,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Japanese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "0006d452e1fe1021794f81e8818f5d6d5d46691250b1c13f5d39f1e75965d587"
-sha256 = "3528e85afd4117de2c22b9f37d32a380a073a49834fa5a3063d21b803606ffbf"
++sha256 = "7ec36f6d490c18a9f9476e1b269699f25c2c570025436696992c065f0c7b0db1"
[[asset]]
path = "crates/ui-egui/src/i18n/uk.tsv"
@@@ -195,7 -195,7 +195,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Ukrainian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "55da029b98a67aed7d2d45bc1d95be79daa2f4ad5b335fbb88478b808d3e5b9a"
-sha256 = "4db7e23074d44305f4584e2cd8b9a0fc35b433cb187dad493c8f7d78a8cd4ad2"
++sha256 = "04717b89193710974701412f456b2b93b262e7be452f1ae223fe9d5e5585b3d4"
[[asset]]
path = "crates/ui-egui/src/i18n/ar.tsv"
@@@ -206,7 -206,7 +206,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Arabic UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "0cf9132ae46c8be2ae1b523f6893d4ce240de9d29084934a387924dbb75228fb"
-sha256 = "2af01de9509db4b4ae61193f41ff0f7f3b70ca5f91cd2afda667e90d34980b25"
++sha256 = "9c98aaa1f66490d6651b14c48878942de6766cde99bc381fb51fb69ff01d6385"
[[asset]]
path = "crates/ui-egui/src/i18n/tr.tsv"
@@@ -217,7 -217,7 +217,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Turkish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "a7d85cb348a800e55473112e556460f3928b20121cb1df6ee77ce74412d3f2cb"
-sha256 = "de988b6959572931c4878a0588109c236bf8c5d46ef57c7a406b6ab42de51339"
++sha256 = "d1f9580a4353971c9a71610e0b34e59a1eafcb8f89c11f256ba0bfbe078874b3"
[[asset]]
path = "crates/ui-egui/src/i18n/lt.tsv"
@@@ -228,7 -228,7 +228,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Lithuanian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "c12015443c50e1afa4b92dd9c621f67e99af8348bcdfff2ea45ff4870032d314"
-sha256 = "63955758227bd57329b22dc7c16ed9cee8b0a15df9453477755849c886424dd5"
++sha256 = "170232ce8f1d7ed3f24e8b8c35dcfb37cfbd7c1ba1f2042a4ffcd57f0732fb28"
[[asset]]
@@@ -240,7 -240,7 +240,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Vietnamese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "efb233ceb06fc20f856ce0275b953b2138554819c21cb575cdaa4de477df9224"
-sha256 = "b54adaa6515dbfb0de3859b30989054e5fcc4f56e66e9cc713c7bf509bdbbac3"
++sha256 = "05db5ed7d5661f426ef6b9720a6b48f6eaa0e3b2f9e99c6e6fce8079f8040323"
[[asset]]
path = "assets/icons/accessibility.svg"
@@@ -3363,7 -3363,7 +3363,7 @@@ licence = "MIT OR Apache-2.0
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Slovene UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
- sha256 = "e7bbd073d32f8109def1f1155e834dc1791927cb6dc251dbcf5a907ca88dc926"
-sha256 = "5881cc7fbfe9da5f5f611309dacf267f95db3a143b916a113b649839019b292c"
++sha256 = "ee773cf1fb101e0a21e77a71f04b1ed3aa99115fdd4d11447e4a80ab8da7ed0f"
[[asset]]
path = "vendor/vello_common/assets/probe.png"
diff --cc crates/engine/src/lib.rs
index 50719d04d,01f162ae7..5c21fee23
--- a/crates/engine/src/lib.rs
+++ b/crates/engine/src/lib.rs
@@@ -1895,10 -1973,9 +1987,11 @@@ impl Edit
Edit::DuplicateField { .. } => Label::of("Duplicate field"),
Edit::SetTabOrder { .. } | Edit::MoveInTabOrder { .. } => Label::of("Set tab order"),
Edit::SetInitialView(_) => Label::of("Change initial view"),
+ Edit::AddAttachment { name, .. } => Label::with("Attach {name}", name.as_str()),
+ Edit::DeleteAttachment { key } => Label::with("Delete attachment {key}", key.as_str()),
Edit::AutoTagText => Label::of("Automatically tag text"),
Edit::SetAltText { .. } => Label::of("Set alternate text"),
+ Edit::AutoTagFormFields => Label::of("Tag form fields"),
Edit::SetTagProperty { .. } => Label::of("Change tag properties"),
Edit::MoveTag { .. } => Label::of("Move object"),
Edit::MarkDecorative { .. } => Label::of("Mark figure as decorative"),
@@@ -2092,10 -2169,9 +2185,11 @@@ fn check_permission(edit: &Edit, p: &pd
| Edit::SetTabOrder { .. }
| Edit::MoveInTabOrder { .. }
| Edit::SetInitialView(_)
+ | Edit::AddAttachment { .. }
+ | Edit::DeleteAttachment { .. }
| Edit::AutoTagText
| Edit::SetAltText { .. }
+ | Edit::AutoTagFormFields
| Edit::SetTagProperty { .. }
| Edit::MoveTag { .. }
| Edit::MarkDecorative { .. }
diff --cc crates/organize/src/lib.rs
index abf0e82dc,3b2873abe..2242563fd
--- a/crates/organize/src/lib.rs
+++ b/crates/organize/src/lib.rs
@@@ -11,9 -11,8 +11,9 @@@
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
- use pdfcraft_cos::{Dict, Document, ObjRef, Object, PdfString};
+ use pdfcraft_cos::{Dict, Document, ObjRef, Object, PdfString, XrefEntry};
+mod attachments;
mod boxes;
mod dedupe;
mod import;
diff --cc crates/ui-egui/src/i18n/vi.tsv
index a3d19acf3,a01b47f8a..2a2e065b9
--- a/crates/ui-egui/src/i18n/vi.tsv
+++ b/crates/ui-egui/src/i18n/vi.tsv
@@@ -2601,8 -2605,13 +2605,18 @@@ key Space Spac
Restore Khôi phục
Use system title bar Dùng thanh tiêu đề hệ thống
Show a basic title bar for the window buttons instead of the tab strip. GNOME doesn't draw title bars for apps, so this one doesn't follow its theme. Hiện thanh tiêu đề đơn giản cho các nút cửa sổ thay vì dải tab. GNOME không vẽ thanh tiêu đề cho ứng dụng, nên thanh này không theo chủ đề của nó.
+ Turn upside down (180°) Lật ngược (180°)
+ 4 x 6 in label (101.6 x 152.4 mm) Nhãn 4 × 6 in (101,6 × 152,4 mm)
+ Cuts each page to its printed area, turns it upright and fits it to the sheet without stretching. One label per sheet. Cắt mỗi trang theo vùng được in, xoay thẳng và vừa với tờ giấy mà không kéo giãn. Mỗi tờ một nhãn.
+ Find untagged content Tìm nội dung chưa được gắn thẻ
+ No untagged content was found. Không tìm thấy nội dung nào chưa được gắn thẻ.
+ Found {n} untagged content problems. Đã tìm thấy {n} vấn đề về nội dung chưa được gắn thẻ.
+ Cut Image Cắt hình ảnh
+ Redact Image Xóa nội dung nhạy cảm của hình ảnh
+ Create Link… Tạo liên kết…
+ Recognize Text… Nhận dạng văn bản…
+ Attach a file… Đính kèm tệp…
+ Delete attachment Xóa tệp đính kèm
+ Attaching files is not available on the web yet Chưa thể đính kèm tệp trên web
+ Attach {name} Đính kèm {name}
+ Delete attachment {key} Xóa tệp đính kèm {key}