---
title: "Discussion on \"JPG to PDF in the browser\" | Hashnode"
description: "Discussion on \"JPG to PDF in the browser\". js\nimport { PDFDocument } from \"pdf-lib\";\n\nasync function imagesToPdf(files) {\n  const pdf = await PDFDocument.create();\n  for (const file of files) {\n    const bytes = await file.arrayBuffer();\n    c"
url: "https://hashnode.com/posts/jpg-to-pdf-in-the-browser/6af8978e119c0c0ba58b739c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [JPG to PDF in the browser](https://toolsdzire.hashnode.dev/jpg-to-pdf-in-the-browser?utm_source=hashnode&utm_medium=feed)

js import { PDFDocument } from "pdf-lib"; async function imagesToPdf(files) { const pdf = await PDFDocument.create(); for (const file of files) { const bytes = await file.arrayBuffer(); c

3d ago · 1 min read · toolsdzire.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#pdf](https://hashnode.com/tag/pdf)
-   [#webdev](https://hashnode.com/tag/webdev)

## Written by

[RAHUL KUMAR](https://hashnode.com/@toolsdzire)

@toolsdzire · New York, USA

  
[View profile](https://hashnode.com/@toolsdzire)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
