open-index/open-npm huggingface dataset:
npm package: @html-to-pdf.io/sdk-javascript
Description: HTML to PDF SDK for TypeScript / JavaScript
Latest version: 0.2.0

# HTML to PDF: TypeScript / JavaScript SDK

TypeScript/JavaScript SDK for [HTML to PDF](https://html-to-pdf.io).

## Installation

```bash
npm install @html-to-pdf.io/sdk-javascript
# or
pnpm add @html-to-pdf.io/sdk-javascript
# or
yarn add @html-to-pdf.io/sdk-javascript
```

## Usage

```typescript
import { htmlToPdf } from "@html-to-pdf.io/sdk-javascript"

const { pdfData } = await htmlToPdf({
  apiKey: "<your-api-key>",
  html: "<html><body><h1>Hello World</h1></body></html>",
  options: {
    margin: {
      top: "1in",
      bottom: "1in",
      left: "1in",
      right: "1in",
    },
  },
})

// pdfData is a base64-encoded PDF string
```

## Supported Environments

- Node.js
- Browser (Webpack, Vite, etc.)

## Documentation

For full documentation, visit [html-to-pdf.io/docs](https://html-to-pdf.io/docs).