1

To gain time and efforts, I want to scan questionnaires (several pages each) into a PDF file and then extract as an image each page and watermark it. I did most of the code in Swift already but cannot figure out how to do the first step (i.e. extract images).

Thank you in advance

user8889350
  • 117
  • 9
  • Have you checked this link? https://stackoverflow.com/questions/3539717/getting-a-screenshot-of-a-uiscrollview-including-offscreen-parts – aBilal17 Jul 05 '18 at 10:53
  • 1
    Do you want to extract the images in the pdf file or do you want to convert each page in the pdf file to an image? Did you try anything? – Willeke Jul 05 '18 at 11:38
  • I want to extract each page as an image (JPEG) to further apply line detection, watermarking and mark recognition. – user8889350 Jul 05 '18 at 12:59
  • To date, I have been able to code the line detection and watermarking on a JPEG image. – user8889350 Jul 05 '18 at 13:01
  • You can use the tool `pdfimages` to extract images from a PDF. It is in the Poppler tools package which you can install on a Mac using **homebrew**, i.e. `brew install poppler` – Mark Setchell Jul 05 '18 at 13:12
  • Take a look at [PDFKit](https://developer.apple.com/documentation/pdfkit) and [PDF Document Parsing](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf_scan/dq_pdf_scan.html#//apple_ref/doc/uid/TP30001066-CH220-TPXREF101). – Willeke Jul 06 '18 at 21:54

1 Answers1

0

When you scan a document the software has a box to select how to save the scan, You can just select the image option and each page will be saved as a separate image. In System Preferences/Printers and Scanners. you have 3 choices to save the scan: TIFF, PNG, or PDF. Be sure to select one of the image options. This will scan each page as a separate image.

Natsfan
  • 4,093
  • 3
  • 22
  • 29
  • Yes jmh I know that but I have thousands of pages to scan ans following your advice I would have to rename each file. I tried to group rename in MacOS which helped a bit. – user8889350 Jul 05 '18 at 20:05