---
title: "Convert image to PDF in Node.js: JPG, PNG, more | Nutrient"
canonical_url: "https://www.nutrient.io/guides/nodejs/conversion/image-to-pdf/"
md_url: "https://www.nutrient.io/guides/nodejs/conversion/image-to-pdf.md"
last_updated: "2026-06-09T10:25:14.496Z"
description: "Learn how to convert images to PDF documents using Nutrient Node.js SDK. Explore supported formats and follow our simple example for seamless conversion."
---

# Convert image to PDF in Node.js

Nutrient Node.js SDK enables you to convert images to PDF documents. For more information on the supported image formats, see the [list of supported file types](https://www.nutrient.io/guides/nodejs/about/file-type-support.md).

The example below loads an image and exports it to a PDF:

```js

import fs from "node:fs";
import { load } from "@nutrient-sdk/node";

const pngImage = fs.readFileSync("source.png");

const instance = await load({ document: pngImage });
const buffer = await instance.exportPDF();

fs.writeFileSync("converted.pdf", Buffer.from(buffer));
await instance.close();

```
---

## Related pages

- [PDF conversion library for Node.js](/guides/nodejs/conversion.md)
- [Convert PDFs to images in Node.js](/guides/nodejs/conversion/pdf-to-image.md)
- [Convert MS Office files to PDF in Node.js](/guides/nodejs/conversion/office-to-pdf.md)

