Javascript - Create PDF How To - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

Javascript – Create PDF How To

How to create PDF file using javascript?

Javascript – create PDF files with JS easily using Bytescout PDF Generator SDK for JavaScript. Use the source code below to simply create PDF in Javascript.

function CreatePDF(IsInternetExplorer8OrLower) {

   // create BytescoutPDF object instance (from bytescoutpdf.js)
   var pdf = new BytescoutPDF();
   // set document properties: Title, subject, keywords, author name and creator name
   pdf.propertiesSet("Sample document title", "Sample subject", "keyword1, keyword 2, keyword3", "Document Author Name", "Document Creator Name");
   
   // add 1st page
   pdf.pageAdd();
   // add page header with anchor
   pdf.textAdd(10, 20, 'sample pdf text', 0);
   
   // return BytescoutPDF object instance
   return pdf;
}
prev
next