setReadOnly method doesn't seem to work
Closed this issue · 1 comments
alaa-ismail commented
Hello,
I'm trying to use the SDK to create read-only fields. I've tried multiple ways but none seem to work. The field always ends up being editable. Below is the code I'm using
const doc = new Document()
doc.appendFile(new File({ name: 'page1', fileId: 'FILE_ID' }))
doc.appendFile(new File({ name: 'page2', fileId: 'FILE_ID' }))
const field = new TextField()
field.setFileIndex(0)
field.setReadOnly(true)
doc.appendFormField(field)
Looking at the source code, I also tried field.setReadOnly({readOnly: 1})
but that didn't work either.
Can you please advise on how to make fields read-only?
alaa-ismail commented
I figured out the cause of the issue. I needed to have field.setSigner("OWNER")
to make it read-only.