Thank you for your response.
I tried importing the first couple xfdfString you provided and they had no issues in importing.
What I notice is that your ‘annotationChanged’ event listener, you create a new event ‘setAnnotationEvent’ that imports the annotation with the xfdfString. I think it would be best if you had a checkbox that is binded with an event that imports the annotations instead of doing so inside the ‘annotationChanged’ event.
If you need further troubleshooting assistance, could you provide a minimal code sample in a package where I can see exact behaviour of what you are trying to achieve? (You can replicate your code on the sample package provided here: https://pdfjs.express/download)
Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.
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
so by above set of code, to some extent i am able to render data, i am not sure whether my code is correct, but as of now it is working.
but now i had came across an issue, here when i click on outside checkbox, to the above set of lines event triggers and i am able to see rectangular annotation on screen, but i need that rectangulat annotation to have thickness as 3, so i added this set of code:
That is the correct way to set the thickness of the tool that is creating the annotation, not the annotation itself.
To change the thickness of the annotation that is being imported, you can use the previous annotationChanged event:
annotationManager.addEventListener('annotationChanged', (annotations, action, { imported }) => {
// imported indicates if the annotations were imported via a process, mainly XFDF
if (imported) {
annotations.forEach(annot => {
annot.StrokeThickness = 3;
console.log('annotation thickness:', annot.StrokeThickness);
});
return;
}
// do event handling
});
Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.
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
Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.
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
hi Kevin,
i am using PDFJS Express Plus to my existing project. Which one you recommened to go with either npm way npm way or the angular way by downloading the js file folder with Angular approach.
incase if your suggestion is for npm way, then is there any links where in i can go through so i can push same for UAT and production, as my application is already in UAT so, please suggest