I want to save the form input field into pdf so that whenever user open the pdf file then he only able to read that not able to edit.
How did you attempt to do it?
I have read this solution on some github issue but its not working on react native to save the edited field so can some one please Help to how can ww do ?.
What actually happened?
I have tried above solution to save the edited pdf and use readonly but it actually not working.
What did you expect to happen?
The Input field edited by user will save the answer into pdf and the other user acess pdf as read only not able to edit it.
How can we reproduce the issue?
` import {
PDFArray,
PDFNumber,
PDFBool,
PDFName,
} from 'pdf-lib';
What were you trying to do?
I want to save the form input field into pdf so that whenever user open the pdf file then he only able to read that not able to edit.
How did you attempt to do it?
I have read this solution on some github issue but its not working on react native to save the edited field so can some one please Help to how can ww do ?.
What actually happened?
I have tried above solution to save the edited pdf and use readonly but it actually not working.
What did you expect to happen?
The Input field edited by user will save the answer into pdf and the other user acess pdf as read only not able to edit it.
How can we reproduce the issue?
` import { PDFArray, PDFNumber, PDFBool, PDFName, } from 'pdf-lib';
const getAcroFields = (pdfDoc: any) => { const acroForm = getAcroForm(pdfDoc); if (!acroForm) return [];
};
const lockField = (acroField: any) => { acroField.set(PDFName.of('Ff'), PDFNumber.of(1 << 0 / Read Only /)); };
const saveFormField = async (url) => {
};`
Version
1.17.1
What environment are you running pdf-lib in?
React Native
Checklist
Additional Notes
Please Help if anyone know how can we save the edited input fileds and save that as read only pdf. @Hopding Thanks