Double-sided printing with a single-sided printer.
Created By: Rohan Doshi
Double-sided printing of long PDF documents prevents paper waste. However, printing double-sided documents with a single-sided printer is often confusing. Nobody wants to:
- Read confusing, wordy instructions
- Manually separate even and odd pages
- Figure out whether to reverse the ordering of the even or odd pages
- Accidentally insert pages into the printer in the wrong orientation This app is meant to simplify this process by providing a simple visual guide that automatically splits and rearranges documents into two halves. This app take the thinking out of printing.
First, the user selects his type of printer (to enable the app to customize the instructions to either inkjet or laser printer designs). Then, the user uploads a PDF file to the server. The server then splits this file into two new, temporary PDF files. The user then follows instructions and clicks on links to directly print these two server-side files (by loading PDF files into invisible iframes via the print.js library).
How to Run
- Change your directory to the folder holding server.py.
- Launch the flask server using the bash command: python server.py
- Open the app by navigating to http://127.0.0.1:5000/ on a web-browser (e.g. Google Chrome)
Design Decision 1: Flask-framework Backend
- Simplicity of setting up server-side endpoints for file uploads
- jQuery is sufficient for handling HTTP POST/GET request to the Flask backend
- Memory - Given limited server-side memory (~4 GB), my server-side code automatically deletes the two temporary server-side PDF files for each upload upon the closing of the client (through a call to the /delete endpoint). This is enabled by generating a 32-bit unique ID that maps each client browser instance to the two corresponding server-side PDF files.
- Security - I need to prevent unauthorized access of static documents via Flask server endpoints. Thus, any PDF documents to my server must remain confidential and not publically accessible.