Skip to content

rngil/dark-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dark-pdf

Test

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


Install

npm install -g dark-pdf

Usage

darkpdf [options] <input.pdf>

Options

Flag Default Description
-o, --output <path> <input>_<theme>_dark.pdf Output file path
-t, --theme <name> claude Theme to apply
-s, --scale <number> 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

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages