Repository navigation
Conversation
Ignored area is defined by passing position (from the upper left corner), width and length of the rectangle.
separated by semicolon
|
Thanks! This looks well-written to me. Can you please clarify these parts?
Color from one of the documents, I take it?
Is this PDF output only or in the GUI viewer too? Makes sense to have it in both I think... |
Negative coordinates are now causing an error, just like negative height/width did
|
While testing with the --view option again, I also noticed a small bug: the preview is not shown when --output-diff is also specified. |
Yes, that is clear (and reasonable). But my question was which of the two possibly different pixels do you choose? Left or right? This is an area where the 2 documents may differ without the diff being rendered. You say that the "original (unmodified) page content" is used, but that can't be — because there are two of them. So which do you pick?
IIRC these are mutually exclusive modes. |
Okay, now I understand what you mean. Currently, it shows the content of the first file. Since my use case was a target-actual comparison, I viewed file1.pdf as the target and file2.pdf as the (possibly modified) actual file. |
This comment was marked as off-topic.
This comment was marked as off-topic.
If the ignore area is specified in a way that it doesn't align with pixels precisely, it has to be rounded outwards to align to pixels; otherwise content changes inside the ignore are could be NOT ignored.
Without this, it was very confusing: the page would show as no-changes, but with no indication of the rectangle in which there _might_ have been changes. This requires differentiating between "there are differences" and "there is a diff image": the former may be false while the latter is true.
Reject empty areas, missing or extra coordinates, trailing separators, and non-finite numbers.

Added an --ignore-area feature that allows users to define one or more rectangular regions to be excluded from PDF comparisons. Multiple rectangles can be specified as a ;-separated list (e.g. --ignore-area="10,10,50,100;20,20,50,100).
This is useful for documents that contain dynamic content such as serial numbers, timestamps, or unique identifiers reoccurring on every page at the same position. In my use case, each generated document contained one or more unique codes (data matrix codes) at fixed positions on the page, causing otherwise identical PDFs to be reported as different.
Pixels within an ignored area are excluded from the pixel-diff count and don't trigger the page-differs flag, but are still rendered using the original (unmodified) page content rather than the diff color overlay. In the output diff PDF, ignored areas are additionally marked with a dashed gray outline so it's clear they were excluded intentionally rather than simply matching.