3 ms·
PDF may have generation date etc, much better to use OCR and compare strings.
by t344344 4y ago
PDF may have generation date etc, much better to use OCR and compare strings.
- crazygringo 4y agoNo, at the end of the day the proposed approach of rendering to an image and comparing pixels is best. Things can go wrong graphically that OCR won't catch, like an entire background color is missing or an image is missing. If you're worried about a generation date in the margin, then compare inside of a bounding box that includes most of the page but not that margin. Or just use a fixed date for the test, even better -- since otherwise you've got to be careful about running the test within a few seconds of midnight anyways.
- ks2048 4y agoThe example here is drawing a red rectangle, so OCR won’t do anything.