I need to verify PDF contents, when I click on pdf print button on web page, it displays PDF to print. How can I verify? Is it possible?
Selenium does not provide any API to verify the contents of a pdf. I am not sure which language binding you are using. However every language has its own specific libraries that help you achieve parsing/extracting contents of pdf. e.g. In Java you might consider using pdfbox or iText.
Capture a screenshot of PDF and compare it with expected image. Article linked here implements image comparison
Download PDF as a file and compare it with expected file. Article linked here implements Comparing Pdf files With Selenium https://seleniummaster.com/sitecontent/index.php/selenium-web-driver-menu/selenium-test-automation-with-java/165-comparing-pdf-documentations-with-selenium#:~:text=Testing%20approach%3A%20use%20Selenium%20Web,two%20packages%20as%20highlighted%20below.
Also check the link to a question
Is there a way to compare content of two text files using selenium? It may not be directly relevant but may provide context on comparing two artifacts.