Skip to content

How to make formcheckbox checked and disabled dynamically? #1397

@LodiLofa

Description

@LodiLofa

I have multiple checkboxes now I want to make one of them checked dynamically and it's not clickable using PDFkit.

Here is what I have tried so far.

// create a document and pipe to a blob
var doc = new PDFDocument();
var stream = doc.pipe(blobStream());

doc.initForm();

doc.formCheckbox('checked', 45,50,16,16, {
    backgroundColor: '#fff'
})

// end and display the document in the iframe to the right
doc.end();
stream.on('finish', function() {
  iframe.src = stream.toBlobURL('application/pdf');
});

How can I make this checkbox be checked automatically and make it disabled so that user can not check or uncheck the checkbox?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions