Re:Ask HN: I scanned an old paper book. How to turn it into ...
by ThinkBeat on Wednesday November 30, 2022 @03:05PM
(#33806839)
Hey thank you.
I will check out Sigil
I did not know about it.
It will be fun to try and match the font
Re:Ask HN: I scanned an old paper book. How to turn it into ...
by pvaldes on Wednesday November 30, 2022 @07:05PM
(#33810049)
> It's a 100 page paperback book, with illustrations and text, on facing pages. The pages are yellowed, so it's not an option simply scan to PDF - they'll need to be cleaned up.
If is a repetitive task it looks more like a job to automatize on imagemagick. Gimp can do it also with plugins, but I would meditate first about imagemagick instead to repeat the same sequence of commands 100 times on Gimp.
Then use a quick script on Perl or your preferred language of choice for writing the main part of the tex file for you. Something like this on pseudocode:
open file output
print $output "lines of preamble";
for each $file in directory "pagesofbook"
{print output.tex "\begin{figure}\includegraphics{$file}\end{figure};\n;}
print output.tex "\end{document}";
close output.tex;
then fine-tune the texfile
It's a 100 page paperback book, with illustrations and text, on facing pages. The pages are yellowed, so it's not an option simply scan to PDF - they'll need to be cleaned up.
I'm undecided about the PDF version, but creating an EPUB is quite interesting:
- Scanned each page with a regular scanner, and cleaned up the illustrations in Gimp
- OCR'd the text using my iPhone (surprisingly quick and easy)
- Identified the typefaces using MyFonts WhatTheFont tool (https://www.myfonts.com/pages/whatthefont)
- Created one long HTML page containing all the text, properly formatted with headings, italics, etc.
- Imported the HTML and graphics into Sigil, splitting it into separate pages (https://sigil-ebook.com/sigil/)
- Exported the EPUB from Sigil
Sigil's UI is slightly daunting at first, but it provides total control over the markup. There are commercial alternatives which are easier to use - Jutoh is highly regarded (https://www.jutoh.com/)