Coder Social home page Coder Social logo

opennotescannerpdf's Introduction

#OpenNoteScanner PDF Creator:

This script will create a final PDF file to use with the Android Application OpenNoteScanner it is based on Python 2.7

####Quick explanation of the code: With a given name for the images and for the final PDF, the code will itinerate based on a maximum amount of pages (right now it is hardcoded 50), it will create the QR images on a 512x512 Pixels, once the QR codes are generated the background images are created.

These Background images are created based on generating one main background (white) the middle image (black) and the top image (white). Those images are pasted together to have a page/image with a "Black Border" with a A4 size based on 300dpi.

Once all this is done will itinerate again on each QR code creating each page of the PDF pasting the codes on the right bottom site of the page.

Finally, we do a itineration on the images so we can append the images into a variable to generate the PDF file.

Note:

  • The images and the PDF are created on a separate directory called QR_Images
  • The name of the images should be at least 4 characters long.
  • Somatimes depending on the OS you have to run the script as sudo or administrator

#####Steps to follow:

  1. Let's update our system:
sudo apt-get update
sudo apt-get upgrade
  1. Let's install the modules needed: We actually need some modules but some of them depend on other modules so for this I have upload a file called requirement.txt which has all packages installed on my computer but you don't need all this modules on you computer, so you have two options to install the packages.
  • Option 1:
sudo pip install Pillow
sudo pip install reportlab
sudo pip install qrcode
  • Option 2:
sudo pip install -r requirement.txt
  1. Let's test the code and the modules let's go to the Test directory and let's execute one of the files. python Multiple_QRcodes.py or python Single_QRcode.py

  2. We are ready to run the script and get the PDF file python Generate_QRcodes_PDF.py This will generate the .pdf file on the QR_Images directory and the final images used on the PDF file in .png

You should get files like this:

Final Images on the PDF

Final PDF

####TO DO list:

  • Remove unnecessary code and variables on the script and directory.

  • Remove unnecessary images.

  • Check if it works on other OS.

  • Fork the code on OpenNoteScanner repository.

  • Better alignment of the images on the final PDF.

  • Investigate why the black border is not completely shown on the images.

  • Improve code to generate the pages as we expect (from 1 to maximum amount of pages).

  • Create global variable for Maximum amount of pages.

  • Improve documentation.

Android Application

Google Play link

GitHub Repository

Some useful links:

Reporlab Module.

QRcode Module.

Pillow Module.

Modules Documentation:

Pillow Documentation.

Reportlab Documentation.

QRcode Documentation.

opennotescannerpdf's People

Contributors

yeyeto2788 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.