Giter Club home page Giter Club logo

leafedit's Introduction

leafedit

leafedit is a command line pdf editor written entirely in rust, that can be used to automate repetative pdf manipulation tasks.

Usage:

Patch:

before any operation can be applied the pdf file must be patched, usage:

leafedit patch <INPUT> <OUTPUT>

example:

leafedit patch myfile.pdf patched.pdf will patch myfile.pdf and save it as patched.pdf

Edit:

operations can now be applied,
usage:
leafedit edit -o 'operation' <INPUT> <OUTPUT>

mulitple operations can be applied at once:
leafedit edit -o 'operation' -o 'operation' -o 'operation' <INPUT> <OUTPUT>

alternatively a path to a file conating a single operation on each line can be supplied as such:
leafedit edit -f <PATH_TO_OPERATIONS_FILE> <INPUT> <OUTPUT>

operation example: "Wr", which adds a string to a pdf, usage:
leafedit edit -o 'Wr (<int>, <int>, <int>, "<string>")' <INPUT> <OUTPUT>

first argument x-coordinate in the pdf content graph

second argument y-coordinate in the pdf content graph

third argument font size

fourth argument string to add to pdf

example:

pdf before Wr

first we must patch the file

leafedit patch uel.pdf temp.pdf

even though the file appears unchanged some every important operations where preformed on the pdf to make edits consistent and speed up editing operations as editing a patched pdf is much faster that having to patch then edit every time

 

now we apply the edits

leafedit edit  \
    -o 'Wr (100, 620, 16, "Ahmed Alaa Gomaa")'  \
    -o 'Wr (435, 620, 16, "20201701804")'  \
    -o 'Wr (178, 374, 12, "17.8/20")'  \
    -o 'Wr (513, 374, 14, "89")'  \
    -o 'Wr (513, 340, 14, "70")'  \
    -o 'Wr (132, 406, 18, "✓")'  \
    -o 'Wr (411, 266, 18, "\u{2713}")'  \
    temp.pdf final.pdf

and here is the output

pdf after Wr

to get a list of all operations run: leafedit list operations
or read the file src/list/_Operations

leafedit's People

Contributors

navyleaf avatar fold-squirrel avatar

Watchers

 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.