# @types/react-native-pdf-lib

> TypeScript definitions for react-native-pdf-lib

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

## Install

```sh
npm install @types/react-native-pdf-lib
pnpm add @types/react-native-pdf-lib
yarn add @types/react-native-pdf-lib
bun add @types/react-native-pdf-lib
```

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2023-11-07 |
| First published | 2019-08-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/react-native-pdf-lib
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-native-pdf-lib
- npm.io page: https://npm.io/package/@types/react-native-pdf-lib

## Recent versions

- 0.2.3 (latest) — 2023-11-07
- 0.2.1 (ts3.6) — 2021-07-08
- 0.2.0 (ts2.0) — 2019-08-02
- 0.2.2 — 2023-10-18

## README

# Installation
> `npm install --save @types/react-native-pdf-lib`

# Summary
This package contains type definitions for react-native-pdf-lib (https://github.com/Hopding/react-native-pdf-lib#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-native-pdf-lib.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-native-pdf-lib/index.d.ts)
````ts
declare let PDFLib: {
    getDocumentsDirectory(): string;
};

export default PDFLib;

export class PDFDocument {
    static create(path: string): PDFDocument;

    addPages(pages: PDFPage[]): PDFDocument;

    /* Saves the document and returns the path to the file it wrote */
    write(): Promise<string>;
}

export interface SetMediaBoxOptions {
    x?: number | undefined;
    y?: number | undefined;
}

export interface TextDrawingOptions {
    x?: number | undefined;
    y?: number | undefined;
    color?: string | undefined;
    fontName?: string | undefined;
    fontSize?: number | undefined;
}

export interface RectangleDrawingOptions {
    x?: number | undefined;
    y?: number | undefined;
    width?: number | undefined;
    height?: number | undefined;
    color?: string | undefined;
}

export interface ImageDrawingOptions {
    x?: number | undefined;
    y?: number | undefined;
    width?: number | undefined;
    height?: number | undefined;
}

export class PDFPage {
    static create(): PDFPage;

    setMediaBox(width: number, height: number, options?: SetMediaBoxOptions): PDFPage;

    drawText(text: string, options?: TextDrawingOptions): PDFPage;
    drawRectangle(options?: RectangleDrawingOptions): PDFPage;
    drawImage(imageUri: string, options?: ImageDrawingOptions): PDFPage;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [Kevin Brown](https://github.com/thekevinbrown).

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