Git Product home page Git Product logo

resonite-webpage-to-pdf's Introduction

REST API and file server for converting webpages to PDFs or images, for consumption in Resonite.

This must be hosted on a machine exposed on the internet so other Resonite users can access the file server.

This documentation is written for Linux, but Windows should work as well.

Running the server:

  1. cd to the root of this repo
  2. Create a venv: python3 -m venv venv
  3. Activate venv: source venv/bin/activate
  4. Install requirements: pip3 install -r requirements.txt
  5. Make a copy of 'config_sample.ini' and rename it to 'config.ini'
  6. Modify config.ini to your liking
  7. Modify main.py Options section to your liking
  8. Run: python3 main.py

Example Usage

Sample configuration:

HOST = "0.0.0.0"
PORT = 2099
DOMAIN = None

Request: GET http://10.0.0.106:2099/convert?url=http://bing.com

Response: http://10.0.0.106:2099/pdfs/aHR0cDovL2JpbmcuY29t.pdf

Optional: Running as a service

  1. Open resonite_webpage_to_pdf.service in a text editor and modify these fields as needed:
    • ExecStart
    • WorkingDirectory
    • User
  2. Copy resonite_webpage_to_pdf.service to /etc/systemd/system/ with command: sudo cp resonite_webpage_to_pdf.service /etc/systemd/system/
  3. Run sudo systemctl daemon-reload to reload the service files
  4. Run sudo systemctl start resonite_webpage_to_pdf to start the service
  5. (Optional) Run sudo systemctl enable resonite_webpage_to_pdf to enable the service on boot

To disable the service on boot: sudo systemctl disable resonite_webpage_to_pdf

To stop the service: sudo systemctl stop resonite_webpage_to_pdf

To check the status of the service: sudo systemctl status resonite_webpage_to_pdf

To delete the service: sudo rm /etc/systemd/system/resonite_webpage_to_pdf.service sudo systemctl daemon-reload

Notes

If you need to update chromium, and you installed it with snap: sudo snap refresh chromium

resonite-webpage-to-pdf's People

Contributors

ikubaysan avatar

Stargazers

Dexy avatar

Watchers

 avatar

resonite-webpage-to-pdf's Issues

Add navigation of webpages

Approaches I can think of:

  1. Involves REST API calls only. a GET endpoint returns a URL of the PDF, in addition to a mapping of bounds to hyperlinks for each page. In Resonite, we check if someone clicked within a valid bounding with their laser, and if so, we go to that hyperlink. These touch-based URL requests should be done by the latest authenticated user (use a latch)

  2. Involves websocket connection. Actively take any laser touch to the PDF view in Resonite, and server determines if a click hit a link. Might be too much.

Keep track of latest selected options

This involves sending back to server if the latest transcription was selected. If so, populate a database (or could just be a json file) of the latest 5 selected options. send this with each ws message?

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.