# svgs2pdf

> A command-line tool for rendering multiple SVG images to multiple or a single PDF file

Latest version **1.1.11** (published 2024-04-20) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install svgs2pdf
pnpm add svgs2pdf
yarn add svgs2pdf
bun add svgs2pdf
```

Provides the command `svgs2pdf`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.11 |
| Published | 2024-04-20 |
| First published | 2024-04-20 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 19.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Huang Rui |
| Maintainers | fernandoherrera |
| Keywords | svg, pdf, svgs2pdf |

## Links

- npm: https://www.npmjs.com/package/svgs2pdf
- Repository: https://github.com/fernandoherreradelasheras/svgs2pdf
- Issues: https://github.com/fernandoherreradelasheras/svgs2pdf/issues
- npm.io page: https://npm.io/package/svgs2pdf

## Dependencies (2)

- [yargs](https://npm.io/package/yargs.md) ^17.x
- [puppeteer](https://npm.io/package/puppeteer.md) ^21.x

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 1.1.11 (latest) — 2024-04-20
- 1.1.10 — 2024-04-20

## README

# svgs2pdf

forked from [svg2pdf-cli](https://github.com/vowstar/svg2pdf-cli/)

A command-line tool for rendering multiple SVG images to multiple or a single PDF file

## Installation

svgs2pdf can be installed from NPM using:

```bash
npm install -g svgs2pdf
```

## Features

* Support single or multiple SVG file input
* Support setting SVG size (width and height), NOTE: This option only can change the svg image size on the PDF page, but can't set PDF page size.
* Support single or multiple PDF file output. When multiple SVG files are provieded single pdf output requires `pdftk` binary installed

Because svgs2pdf uses Chromium to render the svg, it only supports these formats:

Format  |       size
------- | ----------------
Letter  | 8.5in x 11in
Legal   | 8.5in x 14in
Tabloid | 11in x 17in
Ledger  | 17in x 11in
A0      | 33.1in x 46.8in
A1      | 23.4in x 33.1in
A2      | 16.54in x 23.4in
A3      | 11.7in x 16.54in
A4      | 8.27in x 11.7in
A5      | 5.83in x 8.27in
A6      | 4.13in x 5.83in

## Useage

```bash
Usage: svgs2pdf [options] <svg1> ...
Options:
      --help        Show help                                          [boolean]
      --version     Show version number                                [boolean]
  -w, --width       Set width of PDF, allowed units: %, px
  -h, --height      Set height of PDF, allowed units: %, px
  -f, --format      Set format of PDF, allowed options: Letter, Legal, Tabloid,
                    Ledger, A0, A1, A2, A3, A4, A5, A6
  -o, --output-dir  Set the output directory for pdf file(s)
  -m, --merge-file  Set the filename for a single pdf cointaining each svg as a
                    page (requires pdftk)

e.g.: svgs2pdf source1.svg
e.g.: svgs2pdf source1.svg source2.svg source3.svg
e.g.: svgs2pdf -w 100px -h 100px source.svg
e.g.: svgs2pdf -w 100px -h 100px -f A4 --output-dir /tmp source1.svg
e.g.: svgs2pdf -m combined-pdf.pdf source1.svg  source2.svg
```

---
_Source: https://npm.io/package/svgs2pdf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
