15

I would like to develope an application in android. The requirement is to scan a document using the camera and to convert the scanned data to a pdf file, so that it could be used as an attachment in mail.

Please provide me some sample code... Thank you.

Kannan Suresh
  • 4,573
  • 3
  • 34
  • 59
  • Why not just send the image? What do you mean "scan" do you mean OCR and conversion to PDF? – Idistic Jul 22 '11 at 06:31
  • 1
    I would like to digitize any paper documents by photo shooting. Simply take a picture of any paper documents such as receipts, whiteboards, notes, and auto-crop image, enhance image quality and to create an industry standard PDF file, something like the CamScanner app available in android market. – Kannan Suresh Jul 22 '11 at 06:42
  • Were you able to do it? I have downloaded simple pdf for Android but I don't know how to implment it. Can you give me any pointers. – Damir Jun 01 '14 at 23:42
  • hi im working on same type of application... did you find any good api for image cropping and enhancing image quality – ashish.n Feb 16 '15 at 05:16
  • any library is available for croping other than this https://github.com/jhansireddy/AndroidScannerDemo, if so please help me – balajivaishnav Apr 26 '16 at 10:47
  • Did you find anything ? Just to scan, crop and save as JPeg (or any image format) – Kurt Miller Jan 12 '19 at 22:47
  • I found two libraries quite useful: 1- https://github.com/jhansireddy/AndroidScannerDemo 2- https://libraries.io/github/jbttn/SimpleDocumentScanner-Android – Wajid Aug 20 '19 at 05:45

4 Answers4

9

If you are looking for simple PDF functionality you might try this Simple PDF for Android there does not seem to be much else available. If you need OCR Suggestions for Android OCR as to the rest of it you are asking multiple questions, I suggest taking it one step at a time and asking one question per problem you encounter.

Community
  • 1
  • 1
Idistic
  • 6,281
  • 2
  • 28
  • 38
  • 1
    I understood his question... I have the same requirement. not talking about OCR, I just need to take a picture with the phone, then the API should at least help to properly crop the image (if possible enhance it). That's it. Any idea what can help to do that – Kurt Miller Jan 12 '19 at 22:33
6

For anyone looking for easy method, Try this library https://github.com/jhansireddy/AndroidScannerDemo

*Image returned here will be a Bitmap and not a pdf, You can save it with any mime type later on.

Zohair
  • 318
  • 5
  • 12
  • Hi, how did you manages to make this code run? I am getting over and over an `java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app-lib/com.scanner.demo-6/libopencv_java3.so" is too small to be an ELF executable` error on trying to open the camera – Gabriella Angelova Aug 23 '17 at 14:21
  • @GabriellaAngelova You'll need to install OpenCV libraries before using it. Check out http://opencv.org/ – zxcmehran Oct 11 '17 at 16:00
5

Here's an API that looks promising.

"CamScanner API enables your application to automatically detect page borders and smartly remove background. Enhance your image with up to five modes to make the contents clearer and more readable. Return processed documents to your app in JPG or PDF format."

https://dev.camscanner.com/?language=en-us

WCX CIO
  • 51
  • 1
  • 1
1

i'm working on project like this idea , Use mobile vision Api it's result is very good but it depend on image quailty and words font size check this likCheck this Link

ȜAmer Elsayed
  • 55
  • 1
  • 10
  • 2
    _Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline._ – Bugs Feb 08 '17 at 10:07