Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thgossler/replacepdfhyperlinks

A CLI tool for Windows and Linux to search and replace hyperlinks in PDF documents with regular expressions.
https://github.com/thgossler/replacepdfhyperlinks

cli hyperlinks pdf regular-expression replace

Last synced: 5 days ago
JSON representation

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

Awesome Lists containing this project

README

        



[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![AGPL License][license-shield]][license-url]




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][product-screenshot]]([https://github.com/thgossler/ReplacePdfHyperlinks/])

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

### Built With

* [.NET 8 (C#)](https://dotnet.microsoft.com/en-us/)
* [System.CommandLine](https://github.com/dotnet/command-line-api)
* [iText7 for .NET](https://github.com/itext/itext7-dotnet)

## Getting Started

### Prerequisites

* Latest .NET SDK
```sh
winget install -e --id Microsoft.dotnet
```

### Installation as Tool for Use

1. Download the self-contained single-file executables from the [releases](https://github.com/thgossler/ReplacePdfHyperlinks/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
```sh
git clone https://github.com/thgossler/ReplacePdfHyperlinks.git
```
2. Build
```sh
dotnet build
```
3. Run without arguments to get help
```sh
dotnet run
```

Alternatively, you can open the folder in [VS Code](https://code.visualstudio.com/) or the solution (.sln file) in the [Microsoft Visual Studio IDE](https://visualstudio.microsoft.com/vs/) 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 :wink: 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`](https://github.com/thgossler/ReplacePdfHyperlinks/blob/main/LICENSE) for more information.

[contributors-shield]: https://img.shields.io/github/contributors/thgossler/ReplacePdfHyperlinks.svg
[contributors-url]: https://github.com/thgossler/ReplacePdfHyperlinks/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/thgossler/ReplacePdfHyperlinks.svg
[forks-url]: https://github.com/thgossler/ReplacePdfHyperlinks/network/members
[stars-shield]: https://img.shields.io/github/stars/thgossler/ReplacePdfHyperlinks.svg
[stars-url]: https://github.com/thgossler/ReplacePdfHyperlinks/stargazers
[issues-shield]: https://img.shields.io/github/issues/thgossler/ReplacePdfHyperlinks.svg
[issues-url]: https://github.com/thgossler/ReplacePdfHyperlinks/issues
[license-shield]: https://img.shields.io/github/license/thgossler/ReplacePdfHyperlinks.svg
[license-url]: https://github.com/thgossler/ReplacePdfHyperlinks/blob/main/LICENSE.txt
[product-screenshot]: images/screenshot.png