> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markpdf.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Inicio rápido

> Su primera conversión con SDK Node.js/TypeScript en menos de 15 líneas.

# Inicio rápido

## Convertir un archivo local (Node.js)

```ts theme={null}
import { readFile } from "node:fs/promises";
import { MarkpdfClient } from "@markpdf/sdk";

const client = new MarkpdfClient({ apiKey: "YOUR_API_KEY" });

const buffer = await readFile("report.pdf");
const markdown = await client.convertFile(buffer, { filename: "report.pdf", mode: "fast" });
console.log(markdown);
```

## Convertir de URL

```ts theme={null}
const markdown = await client.convertFromUrl(
  "https://bucket.example.com/report.pdf?sig=...",
  { mode: "fast" }
);
```

## Convertir un `File`/`Blob` (navegador o borde, a través de su propio backend)

```ts theme={null}
export async function handleUpload(file: File) {
  const markdown = await client.convertFile(file, { filename: file.name, mode: "fast" });
  return markdown;
}
```

`convertFile` acepta `Buffer`, `Uint8Array`, `Blob` o `File` indistintamente.

## Solicitar metadatos además de Markdown

```ts theme={null}
const result = await client.convertFile(buffer, {
  filename: "report.pdf",
  responseFormat: "json",
});

console.log(result.markdown);
console.log(result.timings.totalRequestMs);
console.log(result.tokenSavedEstimate);
```

Con `responseFormat: "json"`, SDK devuelve un objeto `ConversionResult` escrito en lugar de `string`. Consulte [Referencia](/docs/public/es/sdks/nodejs/reference).

## Siguiente paso

* [Referencia completa del cliente](/docs/public/es/sdks/nodejs/reference)
* [Streaming y trabajos asincrónicos (202)](/docs/public/es/sdks/nodejs/streaming-and-async)
* [Manejo de errores](/docs/public/es/sdks/nodejs/error-handling)
