Skip to content

Keep every page of a document, so annotations land on the right one - #484

Open
giovi321 wants to merge 1 commit into
ddvk:masterfrom
giovi321:fix-page-pairing
Open

giovi321 wants to merge 1 commit into
ddvk:masterfrom
giovi321:fix-page-pairing

Conversation

@giovi321

Copy link
Copy Markdown

Fixes #228, which has been open since March 2023.

Only pages carrying ink are added to the archive's page list, and the exporter takes a page's background from its position in that list. So on a partly annotated document the nth page with ink is drawn over the nth page of the document, which is exactly what the original report describes.

ArchiveFromHashDoc now adds an entry for every page the content file declares, with no data where nobody drew. That puts each page back over its own background, and keeps the untouched pages, which is the other half of the report and what @damienchallet asked for further down the thread.

Measured

A 28 page document, annotated on 14 of them.

before after
pages exported 14 28
backgrounds used source pages 1 to 14, in order each page over its own
pages whose background is not their own 14 of 14 0 of 28

Matching each exported page against every source page by pixel difference is how the background was identified, rather than reading it off the code.

The ink drawn over background page 3 was confirmed to be page 8's by comparing it against a copy of the same page exported by the tablet itself: 15100 of its 15116 ink pixels are the same pixels, 99.9%.

Scope

This is only about which page the ink lands on. It says nothing about where on that page it sits, which is #483. A landscape document needs both to come out right, and testing this one on a landscape document will still look wrong without the other.

Exports of partly annotated documents get longer, since pages nobody drew on are no longer dropped. That is the reported bug rather than a side effect, but it is a visible change to existing behaviour and worth knowing before merging.

Only pages carrying ink were added to the archive's page list, and the
exporter takes a page's background from its position in that list. So on a
partly annotated document the nth page with ink was drawn over the nth page
of the document. Reported in ddvk#228.

Measured on a 28 page document annotated on 14: the export had 14 pages,
the backgrounds were source pages 1 to 14 in order, and the ink from page 8
was drawn over the background of page 3. That ink was confirmed as page 8's
by comparing it against a copy of the same page exported by the tablet
itself, 99.9% of its pixels matching.

Adding an entry for every declared page puts each one back over its own
background, and keeps the pages nobody drew on, which is the other half of
the report. The same document now exports 28 pages, each over its own
source page.

This says nothing about where ink sits on a page. ddvk#483 covers that, and a
landscape document needs both.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unannotated document pages dropped in exported pdf

1 participant