# @cincel.digital/doc-convert-request

> HTTP client for @cincel.digital/doc-convert-plugin package

Latest version **2.1.0** (published 2026-04-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install @cincel.digital/doc-convert-request
pnpm add @cincel.digital/doc-convert-request
yarn add @cincel.digital/doc-convert-request
bun add @cincel.digital/doc-convert-request
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2026-04-06 |
| First published | 2023-07-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Noe Sanchez |
| Maintainers | mautematico, hector.ornelas |

## Links

- npm: https://www.npmjs.com/package/@cincel.digital/doc-convert-request
- npm.io page: https://npm.io/package/@cincel.digital/doc-convert-request

## Dependencies (3)

- [pdf-lib](https://npm.io/package/pdf-lib.md) 1.17.1
- [attr-accept](https://npm.io/package/attr-accept.md) 2.2.2
- [@cincel.digital/fetch-utils](https://npm.io/package/@cincel.digital/fetch-utils.md) 2.1.0

## Recent versions

- 2.1.0 (latest) — 2026-04-06
- 1.2.1-dev.0 (dev) — 2023-08-11
- 2.0.1-dev.2 — 2026-04-06
- 2.0.0 — 2026-04-02
- 1.2.4 — 2025-11-15
- 1.2.2 — 2025-11-15
- 1.2.1 — 2025-11-15
- 1.2.0 — 2023-08-05
- 1.2.0-dev.2 — 2023-08-05
- 1.2.0-dev.1 — 2023-07-16
- 1.2.0-dev.0 — 2023-07-05

## README

# @cincel.digital/doc-convert-request

**@cincel.digital/doc-convert-request** is a package designed to connect with
**@cincel.digital/doc-convert-plugin**, a Hapi plugin that converts documents to
PDF. This package provides HTTP-related functionality for document conversion.

## Installation

```sh
yarn add @cincel.digital/doc-convert-request

# or

npm i @cincel.digital/doc-convert-request
```

## Usage

To use this package, you need to import the function `http` from
**@cincel.digital/doc-convert-request.**

### Converting a File to PDF

The **`http`** function allows you to convert a file to PDF by sending an HTTP
POST request to the specified URL. The function takes two parameters: the URL
and the file to be converted.

```typescript
import { request } from "@cincel.digital/doc-convert-request"

const upload =
const filepicker = document.getElementById("filepicker") as HTMLInputElement

filepicker.addEventListener("change", (event) => {
  const file = event.target.files?.[0]
  if (!file) return
  request("http://example.com/convert", file)
    .then((pdfFile) => {
      return pdfFile
    })
    .catch((err) => {
      console.error(err)
    })
})
```

### Downloading a Raw URL

The **`downloadRawURL`** function allows you to generate a download URL for a
PDF file. It takes a File object as input and returns a URL that can be used for
downloading the file.

```typescript
import { request, downloadRawURL } from "@cincel.digital/doc-convert-request"

const filepicker = document.getElementById("filepicker") as HTMLInputElement

filepicker.addEventListener("change", (event) => {
  const file = event.target.files?.[0]
  if (!file) return
  request("http://example.com/convert", file)
    .then((pdfFile) => {
      const downloadRawURL = downloadRawURL(pdfFile)
      window.open(downloadRawURL, "_blank")

      return pdfFile
    })
    .catch((err) => {
      console.error(err)
    })
})
```

Please note that the **@cincel.digital/doc-convert-plugin** plugin is required
for the proper functioning of this package. Make sure to install and configure
the plugin according to its documentation before using
**@cincel.digital/doc-convert-request**.

---
_Source: https://npm.io/package/@cincel.digital/doc-convert-request · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
