Automating the text selection in PDF using Cypress

Product: PDFTron Webviewer

Product Version: 8.9.0

Please give a brief summary of your issue:
Need to automate the use case where I selected the text in pdf using PDFTron Webviewer and assert the selected text

Please describe your issue and provide steps to reproduce it:
I am using Cypress which is third party tool using which we can write end to end test cases for the UI applications.

I have below scenario to automate in Cypress.
In have an UI application where I have an option to upload the pdf file and select the text in the pdf using the PDFTron Webviewer.

Now I have to automate the above scenario I am able to automate the flow till the upload of file and assert if pdf is loaded or not in Webviewer.
Can you please help me in automating the selecting the text in the pdf and assert the text selected?


Hello chandthousif,

You can use the TextSelectTool.selectText(pt1, pt2) found here: Apryse WebViewer Class: TextSelectTool to actually select the text,

then use
documentViewer.getSelectedText(pageNum) found here: Apryse WebViewer Class: DocumentViewer

Best regards,