Detailed description of issue
{I am trying to add a date field using date picker annotation and after field is added i am able to select the date from the datepicker popup and after saving the document but eventually i am viewing the same document at another place date is visible but it is editable and font size is also reduced which i had set earlier.
i have tried using readonly and locked property but nothing works for the same.}
Expected behaviour
{Date should not be editable and font size should be same while selecting the date
}
Does your issue happen with every document, or just one?
{Yes}
Link to document
{Provide a link to the document in question if possible}
Code snippet
{
let date;
const flags = new Annotations.WidgetFlags();
const font = new Annotations.Font();
font.size = 20;
field = new Annotations.Forms.Field(annot.type, {
type: ‘Tx’,
flags,
font,
});
date = new Annotations.DatePickerWidgetAnnotation(field);
date.TextColor = new Annotations.Color(0, 0, 1, 0.5);
annotationManager.redrawAnnotation(date);
I tried the same using fieldflags and also with locked property but it’ do not worked out infact, issue is that it creates a text field where the user view the pdf and also it decreases the font size to default.
Yeah! thanks that worked i have another issue regarding datepicker tootip i am setting tooltipName: ‘date’ inside the fields. It’s saying ‘undefined’ and also the font size issue in the viewer it automatically reset to default though i have set font size in the field itself. Please refer to the below screenshot.
Also, the font size issue in the viewer it automatically reset to default though I have already set font size in the field itself by using font annotation.
I am saving it in the form of file ‘base64’ basically, but before doing that converting it into filedata and merging annotations using setXFDF() and setFile() and merge() then saving it in base64 form. Hope it helps.
Thank you for providing the code, I wasnt able to reproduce the issue but can you try using the REST API through HTTP requests? The functionality should be similar, but it may be a bug with the Utility SDK.
Best regards,
Tyler Gordon
Web Development Support Engineer
PDFTron
Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here