- Home
- Purchase
- Developer Tools
- BarCode Generator SDK
- BarCode Generator SDK for Javascript for Code 128
- BarCode Reader SDK
- PDF Generator SDK for Javascript
- PDF Extractor SDK
- PDF Renderer SDK
- PDF To HTML SDK
- PDF Viewer SDK
- Spreadsheet SDK
- Image To Video SDK
- Screen Video Capturing SDK
- SWF To Video and Images SDK
- Images Watermarking SDK
- Document SDK beta
- Misc Tools
- Desktop Utilities
- Download
- Support
- Company
- Labs
How to Set Document Properties When Generating PDF file in JavaScript
This sample demonstrates how to set properties of PDF document generated in JavaScript with BytescoutPDF.js (Bytescout PDF Generator for JavaScript).
You can set such document properties as title, subject, keywords, author and creator name.
// function that creates BytescoutPDF instance (defined in BytescoutPDF.js script which have to be included into the same page) // then calls API methods and properties to create PDF document // and returns created BytescoutPDF object instance // this CreatePDF() function is called from Sample.html function CreatePDF() { // create BytescoutPDF object instance var pdf = new BytescoutPDF(); var documentTitle = "Sample document title"; var documentSubject = "Sample subject"; var documentkeywords = "keyword1, keyword 2, keyword3"; var documentAuthor = "Document Author Name"; var documentCreator = "Document Creator Name"; // set document properties: Title, subject, keywords, author name and creator name pdf.propertiesSet(documentTitle, documentSubject, documentkeywords, documentAuthor, documentCreator); // add empty page pdf.pageAdd(); pdf.textAdd(20, 20, 'Document properties are set.', 0); // return BytescoutPDF object instance return pdf; }
Generated PDF file with document properties set (click to view full size):
Filed in:
PDF Generator SDK for Javascript
Tutorials:







