mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-10 10:20:32 -06:00
fix(edit): show backgrounds on pages that paint their own white backdrop
Add Background draws behind the page content, so on a page that first fills itself with opaque white (browsers' Save as PDF, print drivers) the background was hidden completely and the tool looked broken. - pdfcraft-edit: new `backdrop` module. A strictly detected backdrop (one axis-aligned `re`, opaque white in a device colour space, painted before anything else and covering the crop box) is replaced by turning that one fill into `n` in a per-page copy of its stream; the original stream is left untouched for other pages. Remove background restores it, unless the copy was edited since. Page-sized pictures (scans) are reported only. - Background gains `replace_backdrop` (default on); the default colour is a visible light yellow instead of near-white. - Dialog: offers to replace the backdrop, warns about scanned pages, checks pages a few per frame, preview draws text over the colour. - Automation: `doc_background` takes `replace_backdrop`; new read-only `doc_backdrops` lists pages with a backdrop. Acrobat's behaviour on such pages is unobserved; recorded as our choice in parity/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f0c9901c39
commit
a9b0db12c6
@@ -2495,9 +2495,9 @@ tier = "P0"
|
||||
milestone = "M7"
|
||||
status = "shipped"
|
||||
commands = ["edit.background"]
|
||||
tools = ["doc_background"]
|
||||
evidence = ["crates/ui-egui/tests/ui_group/marks.rs::watermark_and_background_dialogs", "crates/engine/src/tests.rs::headers_footers_watermarks_and_backgrounds_show_update_and_remove", "crates/engine/src/tests.rs::backgrounds_and_watermarks_from_files", "crates/ui-egui/tests/ui_group/marks.rs::backgrounds_and_watermarks_from_a_file", "crates/organize/src/tests.rs::a_page_becomes_a_form_xobject_upright"]
|
||||
notes = "colour, or a picture from a file (an image or a page of a PDF) scaled relative to the page"
|
||||
tools = ["doc_background", "doc_backdrops"]
|
||||
evidence = ["crates/ui-egui/tests/ui_group/marks.rs::watermark_and_background_dialogs", "crates/engine/src/tests.rs::headers_footers_watermarks_and_backgrounds_show_update_and_remove", "crates/engine/src/tests.rs::backgrounds_and_watermarks_from_files", "crates/ui-egui/tests/ui_group/marks.rs::backgrounds_and_watermarks_from_a_file", "crates/organize/src/tests.rs::a_page_becomes_a_form_xobject_upright", "crates/automation/tests/backdrop.rs::a_background_shows_on_a_page_that_paints_its_own_white_backdrop", "crates/ui-egui/tests/ui_group/marks.rs::the_background_dialog_offers_to_replace_a_white_backdrop_and_warns_about_scans", "crates/edit/src/backdrop_tests.rs::content_that_is_not_a_page_backdrop_is_left_alone"]
|
||||
notes = "colour, or a picture from a file (an image or a page of a PDF) scaled relative to the page. A page that paints its own opaque white backdrop (browsers' Save as PDF, print drivers) used to hide the background entirely; the dialog now offers to replace that fill (on by default; Remove puts it back unless the content was edited since). Our own choice: Acrobat's behaviour on such pages has not been observed. Still hidden: scanned pages (warned), backdrops drawn inside a form XObject, by a non-rectangular path, or in a named colour space; the dialog preview is a schematic, not the page"
|
||||
|
||||
[[feature]]
|
||||
id = "edit.background-update-remove"
|
||||
@@ -2508,8 +2508,8 @@ milestone = "M7"
|
||||
status = "shipped"
|
||||
commands = ["edit.background.update", "edit.background.remove"]
|
||||
tools = ["doc_background", "doc_remove_marks"]
|
||||
evidence = ["crates/edit/src/tests.rs::replace_and_remove_restore_the_original_content", "crates/engine/src/tests.rs::headers_footers_watermarks_and_backgrounds_show_update_and_remove"]
|
||||
notes = ""
|
||||
evidence = ["crates/edit/src/tests.rs::replace_and_remove_restore_the_original_content", "crates/engine/src/tests.rs::headers_footers_watermarks_and_backgrounds_show_update_and_remove", "crates/edit/src/backdrop_tests.rs::a_white_fill_backdrop_is_replaced_and_put_back_when_the_background_goes", "crates/edit/src/backdrop_tests.rs::a_backdrop_copy_edited_since_is_kept_when_the_background_goes"]
|
||||
notes = "Remove also restores a page backdrop Add replaced"
|
||||
|
||||
[[feature]]
|
||||
id = "edit.decoration-profiles"
|
||||
|
||||
Reference in New Issue
Block a user