# @types/pdf2html

> TypeScript definitions for pdf2html

Latest version **3.1.0** (published 2025-03-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/pdf2html
pnpm add @types/pdf2html
yarn add @types/pdf2html
bun add @types/pdf2html
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2025-03-03 |
| First published | 2025-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51344 |
| Maintainers | types |

## Links

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

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 3.1.0 (latest) — 2025-03-03

## README

# Installation
> `npm install --save @types/pdf2html`

# Summary
This package contains type definitions for pdf2html (https://github.com/shebinleo/pdf2html#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pdf2html.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pdf2html/index.d.ts)
````ts
// Project: https://github.com/shebinleo/pdf2html
// Definitions by: manuzcheruz <https://github.com/manuzcheruz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="node" />

import { Stream } from "stream";

/**
 * Configuration options for PDF to HTML conversion
 */
interface PDF2HTMLOptions {
    binary?: string; // Path to the pdftohtml binary
    first_page?: number; // First page to convert
    last_page?: number; // Last page to convert
    complex?: boolean; // Generate complex output
    single_page?: boolean; // Generate a single HTML file
    no_background?: boolean; // No background images
    no_frames?: boolean; // No frames in HTML
    zoom?: number; // Zoom factor
}

/**
 * Error type for PDF2HTML conversion errors
 */
interface PDF2HTMLError extends Error {
    code?: string;
    path?: string;
    syscall?: string;
}

/**
 * Callback function type for async operations
 */
type PDF2HTMLCallback = (error: PDF2HTMLError | null, html?: string) => void;

/**
 * Convert PDF file to HTML synchronously
 * @param source - Path to PDF file or readable stream
 * @param options - Conversion options
 * @returns HTML string
 */
declare function pdf2htmlSync(source: string | Stream, options?: PDF2HTMLOptions): string;

/**
 * Convert PDF file to HTML asynchronously
 * @param source - Path to PDF file or readable stream
 * @param options - Conversion options
 * @param callback - Callback function
 */
declare function pdf2html(source: string | Stream, options: PDF2HTMLOptions, callback: PDF2HTMLCallback): void;

/**
 * Convert PDF file to HTML asynchronously (overload without options)
 * @param source - Path to PDF file or readable stream
 * @param callback - Callback function
 */
declare function pdf2html(source: string | Stream, callback: PDF2HTMLCallback): void;

declare namespace pdf2html {
    export { pdf2htmlSync };
}

export = pdf2html;

````

### Additional Details
 * Last updated: Mon, 03 Mar 2025 07:02:16 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [manuz cheruz](https://github.com/manuzcheruz).

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