Skip to content

A CLI tool for Windows and Linux to search and replace hyperlinks in PDF documents with regular expressions.

License

Notifications You must be signed in to change notification settings

thgossler/ReplacePdfHyperlinks

Repository files navigation

Contributors Forks Stargazers Issues AGPL License


ReplacePdfHyperlinks

Simple .NET 7 command line (CLI) tool to search and replace URLs in a PDF document with regular expressions.
Report Bug · Request Feature · Contribute · Sponsor project

About The Project

This is a simple .NET command line (CLI) tool to search and replace hyperlinks in a PDF document with regular expressions. It is for example used to change all hyperlinks from localhost to the actual domain name in an auto-generated PDF from a Docusaurus static web site. It was developed because there seemed to be no other free tool that can do this. The tool uses the iText7 library for PDF processing which is licensed under AGPL for non-commercial use. Hence, this tool is also published under the AGPL license.

ReplacePdfHyperlinks screen shot

Note: This tool was written by me in my spare time and will be developed only sporadically.

Built With

Getting Started

Prerequisites

  • Latest .NET SDK
    winget install -e --id Microsoft.dotnet

Installation as Tool for Use

  1. Download the self-contained single-file executables from the releases section

  2. Copy it to a location where you can easily call it and rename it as desired (e.g. to ReplacePdfHyperlinks)

  3. Open a command prompt or PowerShell and type ReplacePdfHyperlinks --help

Installation from Source for Development

  1. Clone the repo
    git clone https://github.com/thgossler/ReplacePdfHyperlinks.git
  2. Build
    dotnet build
  3. Run without arguments to get help
    dotnet run

Alternatively, you can open the folder in VS Code or the solution (.sln file) in the Microsoft Visual Studio IDE and press F5.

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star 😉 Thanks!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the AGPL License. See LICENSE for more information.

About

A CLI tool for Windows and Linux to search and replace hyperlinks in PDF documents with regular expressions.

Topics

Resources

License

Stars

Watchers

Forks

Languages