Disable or readonly annotation

Hello, I have two questions!
I have load an annotation like watermark for the pdf.
I would like to know if it is possible to make that note "READONLY" or "DISABLED", not deletable and not-draggable.
I will attach my json, the note as watermark is place in the first page, under "freeTextAnnotation".
There it is a property to make it "READONLY" or "DISABLED" ?? If not, we would like to have it as feature..





The other request is this:
Is possible to make the pdf viewer on two columns? 
Like Page 1-2 , then 3-4 , on two columns viewer.
If it is possible, can you share an example by loading a pdf ? 
Thanks.


Attachment: example_300e86fc.zip

15 Replies

AA Akshaya Arivoli Syncfusion Team March 16, 2020 08:36 AM UTC

Hi Alessio, 

Thank you for contacting Syncfusion support. 

Please find the details of your query from the below, 

Query 
Details 
I have load an annotation like watermark for the pdf. 
I would like to know if it is possible to make that note "READONLY" or "DISABLED", not deletable and not-draggable. 
I will attach my json, the note as watermark is place in the first page, under "freeTextAnnotation". 
There it is a property to make it "READONLY" or "DISABLED" ?? If not, we would like to have it as feature.. 

We can make the freeText annotation as ‘ReadOnly’ by setting the isLock property to true. Please find the sample for the same from the below, 

Please try it and revert us if you have any concerns on this. 
Is possible to make the pdf viewer on two columns?  
Like Page 1-2 , then 3-4 , on two columns viewer. 
If it is possible, can you share an example by loading a pdf ?  

Currently, we don’t have support to view the pdf document in Double Page View Mode. We have added it to our feature request list.But, we don’t have any immediate plans to implement this feature. At the planning stage for every release cycle, we review all open features. We will implement this feature in any of our upcoming releases.  
  
Now, you can now track the status of your request, review the proposed resolution timeline, and contact us for any further inquiries through below link.   
  


Regards, 
Akshaya 



AL Alessio March 16, 2020 11:20 AM UTC

Thanks for your response.
We will wait the implementation on two columns.
I have a request:
I used viewer.annotationSettings.isLock = true to make readonly the watermark annotation.
It works, but I need to "unlock" all the others annotations, made after the document load.
I just need to lock the watermark, not all the annotations.
Thanks


AA Akshaya Arivoli Syncfusion Team March 17, 2020 08:41 AM UTC

Hi Alessio, 

Thank you for your update. 

We can lock only the freeText annotation using the freeTextSettings available in PDF Viewer. Please find the code snippet from the below, 

    let viewer: PdfViewer = new PdfViewer(); 
    viewer.serviceUrl = 'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'; 
    viewer.appendTo('#pdfViewer'); 
    viewer.load('PDF_Succinctly.pdf', null); 
viewer.freeTextSettings.isLock = true; 


Please find the sample link from the below, 


Please try it and revert us with more details about your requirement and confirm us whether your requirement is to lock each individual annotation, if you have any concerns on this.  

Regards, 
Akshaya 



AL Alessio March 17, 2020 09:21 AM UTC

Hello,
I want to unlock ALL the freeTextAnnotation and I want JUST to lock the watermark (that is a freeTextAnnotation created on the documentLoad).
Is it possible?



AA Akshaya Arivoli Syncfusion Team March 18, 2020 09:27 AM UTC

Hi Alessio, 

Thank you for your update. 

Currently we do not have support to lock the individual annotation, however we already have plans to ‘Expose isLock property for individual annotation’ and the implementation will be included in our 2020 Volume 1 release which is expected to be rolled out in the end of March, 2020. You can track the status using the below link,  


Regards, 
Akshaya  



AL Alessio March 20, 2020 05:03 PM UTC

Ok, we will wait for it.
Anyway, I need to load new pdf documentPath on click of a button.
Currently I have this code, opening a pdf at the load of the page:

var viewer = new ej.pdfviewer.PdfViewer({
                                enableTextSearch: true,
                                documentPath: _documentPath,
                                serviceUrl: init.serviceURL(),
                                documentLoad: function (args) {
                                    viewer.annotationSettings.isLock = true;
                                    viewer.freeTextSettings.isLock = true;
                                    if (search) {
                                        viewer.textSearchModule.searchText(search.trim()); //module
                                    }
                                    viewer.navigationModule.goToPage(page);
                                    viewer.importAnnotations(self.token.watermark + "*" + viewer.pageCount)
                                },
                            });

ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.BookmarkView, ej.pdfviewer.ThumbnailView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.Annotation, ej.pdfviewer.FormFields);
                            //methods
                            viewer.appendTo('#pdfViewer');

---------------------------------------------
At the click of a button, i need to reload the pdf-viewer (without reload the page) with that documentPath.
I tried with the same code, but i get this error:




MS Mohan Selvaraj Syncfusion Team March 23, 2020 10:41 AM UTC

Hi Alessio,                   

We are unable to reproduce the reported issue with the provided details. We have shared the simple sample in which we have tried to reproduce the issue in the below link, 
 
 
Please try it and revert us with more details about your requirement, use case scenario and confirm us whether your requirement is to load the PDF document dynamically from the code behind. These details will be helpful for us to investigate further and assist you better. 

Note: Kindly change the documentPath value based on your requirement and also confirm the Essential studio version which you have been used to reproduce the issue. 
 
Regards, 
Mohan S 



AL Alessio March 23, 2020 11:21 AM UTC

Yes, It works. Thanks


AA Akshaya Arivoli Syncfusion Team March 23, 2020 12:20 PM UTC

Hi Alessio, 

We are glad to know that the reported issue is resolved. Please revert us if you have any other concerns. We are always happy to assist you. 

Regards, 
Akshaya 



AL Alessio March 31, 2020 09:28 AM UTC

Hello.
I have compatibility problems with "Ipad" dimensions, and mobile also.
I need to show the same toolbar buttons as in the desktop view.



I noted that if I reduce the window, I get what I want, with the select button at the right.


But if I come across a mobile device, I get this:



The same happens in your demo:






AA Akshaya Arivoli Syncfusion Team April 1, 2020 07:03 AM UTC

Hi Alessio, 

Thank you for your update. 

Currently PDF Viewer do not support annotations in Mobile devices, however we have already added this to our feature request list, and we do not have any immediate plan to implement the same.  We will let you know once the feature is implemented. You can track the status of the implementation using the below feedback link,   


Regards, 
Akshaya 



AL Alessio April 1, 2020 08:21 AM UTC

Hello,
sorry probably I didnt explain well.
I am not talking about annotations.
If you give a look to the screenshots, you will see that are missing a lot of functionalities in the toolbar on mobile side.
If I open the pdfViewer from desktop and then resize window, you get the select box correctly at the right of the viewer


But If you open it on mobile directly, there isn't that button.


I think it is a bug.
Let me know,
Regards.



AA Akshaya Arivoli Syncfusion Team April 2, 2020 12:24 PM UTC

Hi Alessio, 

Thank you for your update.  

In our PDF Viewer we will render two different types of Toolbar for Desktop and mobile devices. If the PDF Viewer is opened in Desktop then you will get the toolbar as shown below (Figure 1) and if your resize it you will get as in Figure2 

Figure 1: 

 

Figure 2: 
 

Based on the provided details we suspect that you are opening PDF Viewer in Desktop then switching to Mobile mode so you are getting as in Figure 3 , if you refresh it you will get the PDF Viewer in Mobile mode(Figure 4) 

Figure 3 
 

Figure 4: 
 

Please revert us with more details if you need any further assistance. These details will be helpful for us to investigate further and assist you better. 

Regards,  
Akshaya  



SA sample October 13, 2022 06:51 AM UTC

Is there any possibilities to restrict the drag and resize option in stamp annotation (rejected) 



CK Chinnamunia Karthik Chinna Thambi Syncfusion Team October 14, 2022 11:31 AM UTC

Hi sample,


Kindly refer the below code snippet and sample to restrict the drag and resize option in stamp annotation.


Code Snippet:

 

          var viewer = document.getElementById('container').ej2_instances[0];    

        for (var i = 0; i < viewer.annotationCollection.length; i++) {

            if((viewer.annotationCollection[i].shapeAnnotationType === "stamp") && (viewer.annotationCollection[i].icon === "Rejected")){

                viewer.annotationCollection[i].annotationSettings.isLock = true;

                viewer.annotation.editAnnotation(viewer.annotationCollection[i]);

            }

        }

 


Sample: https://stackblitz.com/edit/epldap-y6ehzw?file=index.js,index.html

Steps to lock the rejected annotation:


  • Run the sample
  • Add the Rejected stamp.
  • Click the button. Now the rejected stamp is locked



Regards,

CCM Karthik


Loader.
Up arrow icon