open-index/open-npm huggingface dataset:
npm package: @pdfx-dev/cli
Description: CLI for PDFX - dev server and PDF generation
Latest version: 0.0.1-alpha.1

# @pdfx-dev/cli

CLI and server for PDFX - PDF generation from React components.

> **Alpha Release** - The `serve` command works. `dev` and `add` commands are coming soon.

## Installation

```bash
npm install -D @pdfx-dev/cli
```

## Commands

### `pdfx serve`

Start the PDF generation server.

```bash
npx pdfx serve
npx pdfx serve --port 3456
npx pdfx serve --max-concurrent 10
npx pdfx serve --timeout 60000
```

**Options:**

| Option | Env Variable | Default | Description |
|--------|--------------|---------|-------------|
| `--port` | `PDFX_PORT` | 3456 | Server port |
| `--max-concurrent` | `PDFX_MAX_CONCURRENT` | 5 | Max concurrent PDF generations |
| `--timeout` | `PDFX_TIMEOUT` | 30000 | Request timeout in ms |

### Server Endpoints

```bash
# Generate PDF from HTML
POST /generate
Content-Type: application/json
{ "html": "<html>...</html>" }
# Returns: application/pdf

# Health check
GET /health
# Returns: { "status": "ok", "browser": "connected", ... }
```

## Usage with @pdfx-dev/react

```tsx
import { generate, Document, Page } from '@pdfx-dev/react';

process.env.PDFX_HOST = 'http://localhost:3456';

const pdf = await generate(
  <Document>
    <Page>
      <h1>Hello World</h1>
    </Page>
  </Document>
);
```

## Embedding in Your Server

```ts
import { createServer } from '@pdfx-dev/cli/server';

const pdfServer = createServer({ port: 3456 });
await pdfServer.start();

// Or mount routes in Express
app.use('/pdf', pdfServer.routes);
```

## Docker (Coming Soon)

```bash
docker run -p 3456:3456 ghcr.io/pdfxjs/cli serve
```

## License

MIT
npm package: @pdfx-dev/react
Description: The React framework for PDFs
Latest version: 0.0.1-alpha.1

# @pdfx-dev/react

The React framework for PDFs. Create pixel-perfect PDF documents using React components.

> **Alpha Release** - Core PDF generation works. Some features are still in development.

## Installation

```bash
npm install @pdfx-dev/react
npm install -D @pdfx-dev/cli
```

## Quick Start

### 1. Start the PDF server

```bash
npx pdfx serve
```

### 2. Generate a PDF

```tsx
import { generate, Document, Page, PageNumber } from '@pdfx-dev/react';

// Set the server URL
process.env.PDFX_HOST = 'http://localhost:3456';

// Create your PDF template
const Invoice = (
  <Document title="Invoice #123">
    <Page size="A4" margin="1in" footer={<PageNumber />}>
      <h1>Invoice #123</h1>
      <p>Customer: Acme Corp</p>
      <p>Total: $148.00</p>
    </Page>
  </Document>
);

// Generate PDF
const pdfBuffer = await generate(Invoice);
fs.writeFileSync('invoice.pdf', pdfBuffer);
```

## Components

| Component | Description |
|-----------|-------------|
| `Document` | Root wrapper with metadata (title, author, etc.) |
| `Page` | Page container with size, margins, header/footer |
| `PageNumber` | Current page number |
| `TotalPages` | Total page count |
| `PageBreak` | Force a page break |
| `AvoidBreak` | Keep content together on same page |
| `RepeatableTableHeader` | Table header that repeats on each page |

## API

### `render(element)`

Converts a React element to a self-contained HTML string.

```ts
import { render } from '@pdfx-dev/react';
const html = await render(<Document>...</Document>);
```

### `generate(element)`

Converts a React element to a PDF buffer. Requires `PDFX_HOST` environment variable.

```ts
import { generate } from '@pdfx-dev/react';
const pdf = await generate(<Document>...</Document>);
```

## Page Props

```tsx
<Page
  size="A4"              // "A4" | "Letter" | "Legal" | [width, height]
  orientation="portrait" // "portrait" | "landscape"
  margin="1in"           // string or { top, right, bottom, left }
  header={<div>Header</div>}
  footer={<PageNumber />}
  watermark="DRAFT"      // string or WatermarkConfig
>
  {children}
</Page>
```

## License

MIT
npm package: @pdg/eslint-plugin-react-hook
Description: ESLint Plugin for @pdg/react-hook
Author: YOUNG CHUL PARK
Latest version: 1.0.4

# @pdg/eslint-plugin-react-hook

ESLint Plugin for @pdg/react-hook

## 설치
```
npm install -D @pdg/eslint-plugin-react-hook eslint-plugin-react-hooks
```
npm package: @pdg/react-admin-layout
Description: Admin Layout for React
Author: YOUNG CHUL PARK
Latest version: 1.0.57

# @pdg/react-admin-layout

React Admin Layout

## 설치
```
npm install -D @pdg/react-admin-layout
```

## 추가 패키지 설치
```
npm install -D @emotion/react @emotion/styled @mui/icons-material @mui/material simplebar-react
```

## simplebar-react css 추가
- javascript/typescript 에 추가 시
  ```javascript
  import 'simplebar-react/dist/simplebar.min.css';
  ```

- css/scss 에 추가 시
  ```css
  @import 'simplebar-react/dist/simplebar.min.css';
  ```
npm package: @pdg/react-component
Description: Typescript React Component Module
Author: YOUNG CHUL PARK
Latest version: 1.1.17

# @pdg/react-component

Typescript React Component Module

## 설치
```
npm install -D @pdg/react-component
```

## 추가 패키지 설치
```
npm install -D @emotion/react @emotion/styled @mui/icons-material @mui/material @pdg/react-hook dayjs
```
npm package: @pdg/react-dialog
Description: Typescript React Dialog Module
Author: YOUNG CHUL PARK
Latest version: 1.0.54

# @pdg/react-dialog

Typescript React Dialog Module

## 설치
```
npm install -D @pdg/react-dialog
```

## 추가 패키지 설치
```
npm install -D @emotion/react @emotion/styled @mui/icons-material @mui/material @pdg/react-hook
```
npm package: @pdg/react-form
Description: Typescript React Form Module
Author: YOUNG CHUL PARK
Latest version: 1.2.19

# @pdg/react-form

Typescript React Form Module

## 설치
```
npm install -D @pdg/react-form
```

### 추가 패키지 설치
```
npm install -D @emotion/react @emotion/styled @mui/icons-material @mui/material @mui/x-date-pickers @pdg/react-component @pdg/react-hook @tinymce/miniature @tinymce/tinymce-react dayjs simplebar-react
```

## simplebar-react css 추가
- javascript/typescript 에 추가 시
  ```javascript
  import 'simplebar-react/dist/simplebar.min.css';
  ```

- css/scss 에 추가 시
  ```css
  @import 'simplebar-react/dist/simplebar.min.css';
  ```
npm package: @pdg/react-table
Description: Typescript React Table Module
Author: YOUNG CHUL PARK
Latest version: 1.2.10

# @pdg/react-table

Typescript React Table Module

## 설치
```
npm install -D @pdg/react-table
```

### 추가 패키지 설치
```
npm install -D @dnd-kit/core @dnd-kit/sortable @emotion/react @emotion/styled @mui/icons-material @mui/material @mui/x-date-pickers @pdg/react-component @pdg/react-form @pdg/react-hook dayjs simplebar-react
```

## simplebar-react css 추가
- javascript/typescript 에 추가 시
  ```javascript
  import 'simplebar-react/dist/simplebar.min.css';
  ```

- css/scss 에 추가 시
  ```css
  @import 'simplebar-react/dist/simplebar.min.css';
  ```