![]() ![]() bw_out.pdfįor multiple pages, gs can merge multiple pdf files into one, but img2pdf yields smaller file size than gs. pdf_image.bmp -threshold 40% -compress zip. ![]() Example: gs -sDEVICE=bmpgray -dNOPAUSE -dBATCH -r300x300 \Ĭonvert. ![]() For a one page pdf file, convert does a great job from bmp to pdf. I tried going directly to tiff from the pdf but the quality is not the same so I save each page to bmp. My solution uses gs to extract grayscale bmp files from the pdf, convert to threshold those bmps to bw and save them as tiff files, and then img2pdf to compress the tiff images and merge them all into one pdf. I wanted bw pdfs with good image quality and small file size. convert yields very poor results when used directly. However, that gs code only converts to grayscale (as asked in the question) and still has large file size. I tried using gs with the code listed here, and image quality is good with pdf text still there. I also had some scanned color pdfs and grayscale pdfs that I wanted to convert to bw. This to concatenate the pdfpages into one:Īnd last I add an OCRed text layer that doesn't change the quality of the scan in the pdfs so they can be searchable: Second remove shadows, noise, text from the next page bleeding through (credits to this blog ) Best way I found out there, without quality loss, removes shadows, noise, text from the next page bleeding through etc:
0 Comments
Leave a Reply. |