PDF command-line utils written in Rust

Overview

rpdf

PDF command-line utils written in Rust.

rpdf makes working with PDF annotions super easy! It can merge annotations from multiple files, some show statistics (stats) or strip specific (or all) annotations.

Crates.io

  1. About
  2. CLI Reference
  3. Contributing

About

rpdf is a Rust binary that aims to provides an open source and straighforward command-line alternative to other tools such as PDF Annotator and others.

Disclaimer: rpdf is currently in an early stage, and does not implement many features. I was first developed for my own use, because I needed to merge annotations from PDFs I review with other people. Do not hesitate to propose new features if you feel they could be intersting!

Installation

You can install the latest version with cargo.

> cargo install rpdf

CLI Reference

The command line tool is pretty straighforward to use and is self-documented:

CLI

Anytime you need help for a command, you can use rpdf <COMMAND> --help, or -h for the short version.

Examples

Annotations statistics

You can count how many annotations your file contains:

statistics

And you can also do this per page:

statistics-per-page

Merge annotations

Say we have to files with the same content but different annotations:

statistics-two-files

You can merge the annotations from both files into one with the merge command, and verify that all the annotations are present in the final product:

merge

Strip annotations

If you want to remove some annotations from a PDF, you can do so with the strip command:

strip

By default, strip excludes Link annotations from the removal process. You can modifiy the behavior with the -e/--exclude parameter.

Contributing

Contributions are more than welcome! Please reach me via GitHub for any questions: Issues, Pull requests or Discussions.

Comments
  • chore(deps): bump anyhow from 1.0.70 to 1.0.71

    chore(deps): bump anyhow from 1.0.70 to 1.0.71

    Bumps anyhow from 1.0.70 to 1.0.71.

    Release notes

    Sourced from anyhow's releases.

    1.0.71

    • Documentation improvements
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • chore(deps): bump baptiste0928/cargo-install from 1 to 2

    chore(deps): bump baptiste0928/cargo-install from 1 to 2

    Bumps baptiste0928/cargo-install from 1 to 2.

    Release notes

    Sourced from baptiste0928/cargo-install's releases.

    v2.0.0

    :sparkles: New major release. This new version should remove the warning about Node 12 being deprecated, along with some improvements to the default behaviour. I also rewrote and improved most of the code.

    Added

    • Name and version are shown in the cache key. This allows to identify cache entries in the cache management UI more easily.

    Changed

    • Breaking: The action now runs on Node.js 16.
    • Breaking: Versions without semver range (e.g. 1.2.3) are now considered as exact versions.
    • Breaking: Set --locked by default. locked input is no longer deprecated.
    • Various code improvements and refactoring.

    v1.3.1

    Fixed

    • Use semver instead of compare-versions to fix version resolution issues.
    • Dependencies have been updated. This removes the warning about set-output being deprecated.

    v1.3.0

    Added

    • Add args input to add additional arguments to the cargo install command.

    Deprecated

    • locked input is deprecated, use the args input with --locked instead.

    v1.2.0

    Added

    • Add locked input to add --locked argument to cargo install command.

    Changed

    • Dependencies have been updated.

    v1.1.0

    Added

    • Add cache-key input to add a custom key to the automatic cache key.

    v1.0.1

    Fixed

    • Errors when saving cache no longer cause the workflow to fail.
    Changelog

    Sourced from baptiste0928/cargo-install's changelog.

    [2.0.0] - 2023-03-23

    Added

    • Name and version are shown in the cache key. This allow to identify cache entries in the cache management UI more easily.

    Changed

    • Breaking: The action now runs on Node.js 16.
    • Breaking: Versions without semver range (e.g. 1.2.3) are now considered as exact versions.
    • Breaking: Set --locked by default. locked input is no longer deprecated.
    • Various code improvements and refactoring.
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • chore(deps): bump actions/checkout from 1 to 3

    chore(deps): bump actions/checkout from 1 to 3

    Bumps actions/checkout from 1 to 3.

    Release notes

    Sourced from actions/checkout's releases.

    v3.0.0

    • Updated to the node16 runtime by default
      • This requires a minimum Actions Runner version of v2.285.0 to run, which is by default available in GHES 3.4 or later.

    v2.7.0

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v2.6.0...v2.7.0

    v2.6.0

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v2.5.0...v2.6.0

    v2.5.0

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v2...v2.5.0

    v2.4.2

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v2...v2.4.2

    v2.4.1

    • Fixed an issue where checkout failed to run in container jobs due to the new git setting safe.directory

    v2.4.0

    • Convert SSH URLs like org-<ORG_ID>@github.com: to https://github.com/ - pr

    v2.3.5

    Update dependencies

    v2.3.4

    v2.3.3

    ... (truncated)

    Changelog

    Sourced from actions/checkout's changelog.

    Changelog

    v3.5.2

    v3.5.1

    v3.5.0

    v3.4.0

    v3.3.0

    v3.2.0

    v3.1.0

    v3.0.2

    v3.0.1

    v3.0.0

    v2.3.1

    v2.3.0

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • chore(deps): bump clap from 4.2.5 to 4.2.7

    chore(deps): bump clap from 4.2.5 to 4.2.7

    Bumps clap from 4.2.5 to 4.2.7.

    Release notes

    Sourced from clap's releases.

    v4.2.7

    [4.2.7] - 2023-05-02

    Fixes

    • Correctly track remaining length for iterators provided by ArgMatches

    v4.2.6

    [4.2.6] - 2023-05-02

    Features

    • impl Eq<std::any::TypeId> for clap_builder::util::AnyValueId
    Changelog

    Sourced from clap's changelog.

    [4.2.7] - 2023-05-02

    Fixes

    • Correctly track remaining length for iterators provided by ArgMatches

    [4.2.6] - 2023-05-02

    Features

    • impl Eq<std::any::TypeId> for clap_builder::util::AnyValueId
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
Owner
Jérome Eertmans
PhD student, with a Master in Electromechanical Engineering
Jérome Eertmans
Generating PDF files in pure Rust

pdf-canvas A pure rust library for generating PDF files. Currently, simple vector graphics and text set in the 14 built-in fonts are supported. To use

Rasmus Kaj 128 Jan 1, 2023
An easy-to-use library for writing PDF in Rust

printpdf printpdf is a library designed for creating printable PDF documents. Crates.io | Documentation [dependencies] printpdf = "0.3.2" Features Cur

Felix M. Schütt 592 Jan 8, 2023
A Rust library for PDF document manipulation.

lopdf A Rust library for PDF document manipulation. Example Code Create PDF document #[macro_use] extern crate lopdf; use lopdf::{Document, Object, St

Junfeng Liu 1.1k Dec 30, 2022
Generate PDF files with JavaScript and WASM (WebAssembly)

WASM-PDF Generates PDF files directly in the browser with JavaScript and WASM (WebAssembly). Idea here is to push all the work involved in creating a

Jussi Niinikoski 369 Jan 2, 2023
docx-you-want is a tool to convert a PDF document into a .docx file

ddocx-you-want is a tool to convert a PDF document into a .docx file ... in an unusual way. Since these two formats are inherently differ

null 45 Dec 23, 2022
PDF Structure Viewer, This tool is useful for when working with PDFs and/or lopdf.

PDF Structure Viewer Inspect how the PDF's structure looks. This tool is useful for when working with PDFs and/or lopdf. This application is used lopd

Ralph Bisschops 13 Nov 21, 2022
Image cropper (and colorizer) for pdf scans

Image cropper for personal use (might not work with your pdfs) Requires pdfimages on the path to work properly It's thought just for my workflow so is

cdecompilador 2 Nov 7, 2022
Make a PDF file by writing kind of like HTML and CSS.

markup-pdf-rs The Rust library for making a PDF files by writing kind of like HTML and CSS. Inspired by Satori and React-pdf. This library makes a PDF

null 9 Jan 10, 2023
Rust Util Collection, a simple and friendly error-chain, with many useful utils as an addition.

RUC Rust Util Collection, a simple and friendly error-chain, with many useful utils as an addition. The painful experience of using error-chain gave b

漢 6 Mar 27, 2022
My utils for long-lived, fault-tolerant rust tasks

Sisyphus Utilities for long-running, resilient tasks. This library contains code I wrote, found useful, and want to keep using. It aims to provide sys

James Prestwich 25 Dec 30, 2022
Utils for flashbots/mempool-dumpster

Intro This is a helper library and cli tool to work with https://github.com/flashbots/mempool-dumpster/, provider of historical mempool data for Ether

Vitaly Drogan 30 Oct 10, 2023
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
A backend for mdBook written in Rust for generating PDF based on headless chrome and Chrome DevTools Protocol.

A backend for mdBook written in Rust for generating PDF based on headless chrome and Chrome DevTools Protocol.

Hollow Man 52 Jan 7, 2023
Converts books written in Markdown to HTML, LaTeX/PDF and EPUB

Crowbook Crowbook's aim is to allow you to write a book in Markdown without worrying about formatting or typography, and let the program generate HTML

Élisabeth Henry 567 Dec 29, 2022
Generating PDF files in pure Rust

pdf-canvas A pure rust library for generating PDF files. Currently, simple vector graphics and text set in the 14 built-in fonts are supported. To use

Rasmus Kaj 128 Jan 1, 2023
An easy-to-use library for writing PDF in Rust

printpdf printpdf is a library designed for creating printable PDF documents. Crates.io | Documentation [dependencies] printpdf = "0.3.2" Features Cur

Felix M. Schütt 592 Jan 8, 2023
A Rust library for PDF document manipulation.

lopdf A Rust library for PDF document manipulation. Example Code Create PDF document #[macro_use] extern crate lopdf; use lopdf::{Document, Object, St

Junfeng Liu 1.1k Dec 30, 2022
A rust program to bruteforce ZIP, PDF and some popular hashes.

Veldora A program to bruteforce zips, pdfs and some popular hashes. This is basically a rust version of bruttle, but a lot faster. Installation: git c

Aquib 30 Dec 28, 2022
An mdBook single PDF generator using pure Rust and some Node.js

mdbook-compress An mdBook backend renderer to generate a single PDF file for a full book. There are other similar projects, but most rely on chrome in

nxe 44 Jan 20, 2023