Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diplodoc-platform/pdf-generator
https://github.com/diplodoc-platform/pdf-generator
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/diplodoc-platform/pdf-generator
- Owner: diplodoc-platform
- License: mit
- Created: 2023-10-20T02:31:46.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-21T10:27:17.000Z (6 months ago)
- Last Synced: 2024-11-03T13:02:26.334Z (about 2 months ago)
- Language: TypeScript
- Size: 1.4 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# pdf-generator
Package to turn Diplodoc projects into PDFs.
## Installation
```
npm i -g @diplodoc/pdf-generator
```## Usage
### Step 1: Generate Single Page Files
Run `@diplodoc/cli` command. This will create an output folder with a single page file for each Table of Contents (ToC) file.
```
npx -- @diplodoc/cli@latest -i ./docs -o ./docs-output --single-page
```### Step 2: Convert Single Page Files to PDFs
Run the `@diplodoc/pdf-generator` command. This will create PDF files right next to the single page ones.
```
npx -- @diplodoc/pdf-generator@latest -i ./docs-output
```## Development
### Prerequisites
* node >= 18.x
* graphicsmagick
* ghostscript#### Don't have graphicsmagick and ghostscript yet?
Follow [this](https://github.com/yakovmeister/pdf2image/blob/HEAD/docs/gm-installation.md) guide to install the required dependencies.
### Run test
```
npm run test
```