You have to have a data length higher than 4 character because if you do not do it you'll get the error QR data length should be higher than 4. Qr_data = The data you want to have on the QR image If not the application will return the message Please check size. Page_size = Should be either A4 or letter Now we can open up a browser tab or window and go to the 127.0.0.1:800/api/// where: Run the server by the following command: python run_server.py or sudo python run_server.py
#OPEN SOURCE SCANNER PDF CREATOR HOW TO#
How to run the code for the server in Linux:įollow steps for CLI operations first to that code is working properly
pdf file on the PDF directory and the final images used on the. Run the code by typing on the terminal the following command: python generate_single_pdf.py or sudo python generate_single_pdf.py We are ready to run the script and get the PDF file Let's go to the Test directory and let's execute one of the files.Įxecute this on the terminal: python Multiple_QRcodes.py or python Single_QRcode.py How to run the code through CLI in Linux:
#OPEN SOURCE SCANNER PDF CREATOR GENERATOR#
pdf file generated using the main pdf generator script with the following information: The API is pretty straight forward, it only have one endpoint which is in /api/// so an example will be something like /api/A4/P01_V05_S/50Īnd the API will return a. This server application is developed with Flask framework and it just have only 1 landing page ( index.html) with some information about how to use the API and some other info. If you want more deep information please have a look at the auto generated documentation here.
pdf placing the QR images on the right bottom site of the page. Once all images are done, it will iterate over each QR image generated previously creating each page of the. Those images are pasted together to have a final image with a "Black Border" with an A4 or letter size with a resolution of 300dpi.
Once the QR images are generated the background images are created, these Background images are generated as: pdf file name and a maximum amount of pages, it will create QR images of 512x512 Pixels with the QR data given plus a number ant the end of the data. Quick explanation of the code: Main PDF Generator script