# modify-pdf

> Typesafe library for making simple modifications to PDFs.

Latest version **0.6.1** (published 2023-07-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install modify-pdf
pnpm add modify-pdf
yarn add modify-pdf
bun add modify-pdf
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.1 |
| Published | 2023-07-07 |
| First published | 2023-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 71.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jrobsontull |
| Maintainers | jrobsontull |
| Keywords | pdf, typescript |

## Links

- npm: https://www.npmjs.com/package/modify-pdf
- Repository: https://github.com/jrobsontull/pdf-modify
- Homepage: https://github.com/jrobsontull/pdf-modify#readme
- Issues: https://github.com/jrobsontull/pdf-modify/issues
- npm.io page: https://npm.io/package/modify-pdf

## Dependencies (1)

- [pdf-lib](https://npm.io/package/pdf-lib.md) ^1.17.1

## 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

- 0.6.1 (latest) — 2023-07-07
- 0.6.0 — 2023-07-07
- 0.5.0 — 2023-07-06
- 0.4.1 — 2023-07-05
- 0.4.0 — 2023-07-01
- 0.3.3 — 2023-07-01
- 0.3.2 — 2023-07-01
- 0.3.1 — 2023-06-30
- 0.3.0 — 2023-06-30

## README

<div align="center">
    <h1>modify-pdf</h1>
    <p>Typesafe library for performing simple modifcations of PDF files.</p>
    <p>Currently a <strong>WIP</strong> whilst we work torwards a stable release. <strong>PRs</strong> welcome.</p>
     <a href='https://img.shields.io/npm/v/modify-pdf'><img src='https://img.shields.io/npm/v/modify-pdf' /></a>
    <a href='https://github.com/jrobsontull/modify-pdf/actions/workflows/build.yml'><img src='https://github.com/jrobsontull/modify-pdf/actions/workflows/build.yml/badge.svg' /></a>
   <a href='https://github.com/jrobsontull/modify-pdf/actions/workflows/test.yml'><img src='https://github.com/jrobsontull/modify-pdf/actions/workflows/test.yml/badge.svg' /></a>
   <a href='https://github.com/jrobsontull/modify-pdf/actions/workflows/coverage.yml'><img src='https://github.com/jrobsontull/modify-pdf/actions/workflows/coverage.yml/badge.svg' /></a>
</div>

## Table of Contents

- [Why?](#why)
- [Getting Started](#getting-started)
- [Documentation](#documentation)
- [Toubleshooting](#troublshooting)
- [Contributing](#contributing)

## Why?

`pdf-lib` provides a thorough toolset for manipulation of PDF files within JavaScript environments. This library provides an abstraction over `pdf-lib` for common tasks such as copying, merging, rotating, inserting and more!

## Getting Started

### npm

Install the package using the package manager of your choice.

```bash
npm install modify-pdf
```

### yarn

```bash
yarn add modify-pdf
```

### pnpm

```bash
pnpm install modify-pdf
```

<br/>

`modify-pdf` can then be imported into your app as follows:

```tsx
import { loadLocalDocument, rotateDocument } from 'modify-pdf';
import { PDFDocument } from 'pdf-lib';

const document: PDFDocument = await loadLocalDocument('example.pdf');
const rotated: PDFDocument = rotateDocument(document, 90); // 90° rotation
```

## Documentation

Please refer to our [documentation](https://jrobsontull.github.io/modify-pdf) page. Alternatively, the documentation can be found at `docs/index.md`.

This pacakage is still a work in progress. Current status:

- Creating PDFs ✅
- Loading PDFs ✅
- Rotating ✅
- Merging ✅
- Copying ✅
- Metadata ✅
- Inserting (WIP)
- Testing (WIP)
- Examples (WIP)

## Troubleshooting

If you are having issues, please check the [documentation](https://jrobsontull.github.io/modify-pdf) first and the troubleshooting section there. If that does not help, feel free to open an [issue](https://github.com/jrobsontull/modify-pdf/issues).

## Contributing

We wlecome any and all contributions. Contribution guidelines will be updated soon but in the meantime there are some useful snippets below.

We use `yarn` as a package manager. Before raising a PR, lint and format the codebase with the following commands:

```bash
yarn lint
yarn format
```

All tests can be found in `./test/`. Tests are run with `jest` and can be initiated with:

```bash
yarn test
```

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