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

https://github.com/rngil/dark-pdf

Simple CLI tool to convert pdfs to dark mode, with TOC preservation
https://github.com/rngil/dark-pdf

dark-mode dark-theme pdf pdf-converter pdfjs

Last synced: 6 days ago
JSON representation

Simple CLI tool to convert pdfs to dark mode, with TOC preservation

Awesome Lists containing this project

README

          

# dark-pdf

[![Test](https://github.com/rngil/dark-pdf/actions/workflows/test.yml/badge.svg)](https://github.com/rngil/dark-pdf/actions/workflows/test.yml)

Convert PDFs to dark mode, with table of contents preservation.

---

## Install

```sh
npm install -g dark-pdf
```

## Usage

```sh
darkpdf [options]
```

### Options

| Flag | Default | Description |
| ---------------------- | -------------------------- | ------------------------- |
| `-o, --output ` | `__dark.pdf` | Output file path |
| `-t, --theme ` | `claude` | Theme to apply |
| `-s, --scale ` | `3` | Render quality multiplier |
| `-h, --help` | N/A | Show help |

### Themes

| Name | Color |
| ---------- | ------------- |
| `classic` | Pure black |
| `claude` | Claude Warm |
| `chatgpt` | ChatGPT Cool |
| `sepia` | Sepia Dark |
| `midnight` | Midnight Blue |
| `forest` | Forest Green |

## Programmatic API

```js
import { convert, THEMES } from "dark-pdf";

const outPath = await convert("/path/to/input.pdf", {
theme: "claude",
output: "/path/to/output.pdf",
scale: 3,
onProgress: ({ page, total }) => console.log(`${page}/${total}`),
});
```

---

Logo from [icon-icons.com](https://icon-icons.com/fr/icone/fichier-pdf/245974).