Add save as single-page PDF.
Needs ReviewPublic

Authored by acordonnier on Jun 26 2018, 12:31 PM.

Details

Reviewers
sars
Summary

Add save as single-page PDF. Fix bug 299517

PDF is created using QPdfWriter and painting a QImage. The actual image in the PDF is JPEG with good (maybe best) quality available. Skanlite quality setting is not used.

FEATURE: 299517

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
acordonnier requested review of this revision.Jun 26 2018, 12:31 PM
acordonnier created this revision.
sars added a comment.Jun 27 2018, 12:18 PM

Thanks for the patch!

I'm just afraid that the original bug will not be fixed...: "I don't want to send anybody an 15.000 x 10.000 image - but I also don't want to send them an image with poor quality. I want to send them a pdf - and not do a lot of work to get there."

It does not help if I send the 15.000 x 10.000 image inside a one page PDF as the file is actually bigger than it would be if I would just send the image in the format that Qt uses for it in the PDF (I don't remember the format at the moment).

What the original bug reporter really wants is for Skanlite (or Skanpage) to scan the document do OCR on it and just have the text sent... That is however not so trivial as not even Google's highest-end OCR does this without errors. What can be done is to have a lower resolution/quality image and a layer with OCR-ed text for searching and copy&paste.

I'm a bit afraid that the PDF format also would be used for photos, which is not a very good idea (I have experienced this when I was in charge of making a photo-calendar and got the scanned photos in a multi-page-pdf) :)

I think the best thing would be to put the "PDF document energy" on Skanpage. My own itch to do Skanpage at the moment is not that high, but maybe you have the itch to improve Skanpage and make it a real KDE application?

Hi Kåre.

The original bug does not mention OCR or the need for more compression but an easy way to send a PDF. At 600 dpi, I get a PDF with excellent quality for text and graphics. The embedded image is about 5000×7000. Another bug can be filled if an optimised PDF is wanted.

For OCR, there is Kooka which was ported to KF5 last autumn. PDF can also be optimised without OCR by using masks (as in DJVU): low res background, high res 1-bit mask (text), high res foreground.

I will try to work on Skanpage. I have almost no experience in software development though. It was my first code contribution to a FOSS project.