Open randfee opened 6 years ago
just now realised, this seems similar to #261
Yes, it's the same
Never mind, this case turned out to be a bit different due to the internal structure of the PDF.
The version 7.x changes do not help for this file. The JPEG resolution (150x150) is half that of the stencils (300x300), and to deskew I have to rasterize everything at the resolution of the stencils.
I have thought about implementing deskew by instructing the PDF viewer to draw the page contents at an angle that compensates for skew, but I strongly suspect some second tier viewers might not handle this well. Could also have some undesirable effects for say, a digitally inserted watermark that is perfectly aligned on top of a scanned page.... I could see how that goes.
Image segmentation and color reduction at the output side would also fix, effectively by reconstructing a similarly optimized PDF.
The output PDF increases more than a factor of six for files scanned with our industrial scanner/copier as soon as I add deskew or clean-final. Here's a demo file: Instructions.pdf
ocrmypdf -l eng Instructions.pdf Instructions_justOCR.pdf
-->output-size = 1.55x input sizeocrmypdf -l eng --deskew Instructions.pdf Instructions_OCR&deskew.pdf
-->output-size = 6.57x input sizeit might have something to do with the file having jpg pages as well as ccitt ones. Also, the files have multiple stencils per page. I check for that using:
pdfimages -list Instructions.pdf
If I had to guess, it'd make sense to ignore all those stencils and just go for the images.