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.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):

Click to view full size