jsPDF + Html2Canvas Tutorial to Add Arabic Custom Font inside PDF Document in Javascript Full Project For Beginners

You are currently viewing jsPDF + Html2Canvas Tutorial to Add Arabic Custom Font inside PDF Document in Javascript Full Project For Beginners

 

 

Welcome folks today in this post we will be adding arabic custom font inside pdf document with the help of jspdf and html2canvas library. All the source code of the application is shown below.

 

 

 

 

Get Started

 

 

 

In order to get started you need to add the following libraries which are jspdf and html2canvas we will be adding their cdn. So make a index.html file and copy paste the following code to include the cdn.

 

 

 

 

Now we will add a div element where we will add the arabic text to convert to pdf. So make this div tag and give a unique id to it

 

 

 

So you can see we have added a simple h1 tag and inside it we have written some arabic text. And now we need to include some custom javascript to build the application

 

 

 

 

So now if you open the index.html file you will see the following result

 

 

 

 

 

 

Full Source Code

 

 

 

 

 

Leave a Reply