How to Create PDF Files in Deno Using PDF-LIB Library Full Tutorial with Example

You are currently viewing How to Create PDF Files in Deno Using PDF-LIB Library Full Tutorial with Example

 

 

 

Welcome folks today in this blog post we will be creating pdf files in deno using pdf-lib. This is will be a full tutorial example with source code.

 

 

Requirements

 

 

You should have Deno installed on your system before you proceed

 

 

Get Started

 

 

Now make a app.ts file inside your root directory and copy paste the following code

 

 

 

 

 

 

Now if in order to execute this script by deno you need to execute this following command which is shown below.

 

 

deno run --allow-write app.ts

 

 

 

 

 

 

Now there is a flag there --allow-write which is required in the command to allow write access to deno in order to create new files on the system.

 

 

Now if you check the root directory a create.pdf will be created which is shown below.

 

 

 

 

Now if you open this file you will see the following result

 

 

 

 

Leave a Reply