Home > Automation Testing > Read PDF File using Protractor

Read PDF File using Protractor

Pre-requisite: To read pdf file, first we need to install pdf2json library.

Step to install pdf2json

Prerequisite : System should have nodejs Installed.

  • Open COMMAND prompt and go to directory .
  • Write npm i pdf2json  and press enter.

Once library is installed you will see below screen

 

Below is the code which shows how to read PDF file.

 

 

This Article is TAGGED in , , , , . BOOKMARK THE permalink.

Avatar photo
Neeraj Vishwakarma
Senior QA Engineer Skills: Automation Testing, Manual Testing, STLC, Java, Selenium Webdriver, Protractor, Database Testing.

2 thoughts on “Read PDF File using Protractor

  1. Great example! Thanks.

    How would I go about retrieving individual items from the PDF file? For example I have tables with a summary. How can the summary be distinguished from the remainder of the document?

    The summary is structured as show here:

    Profile Total 24.99% 25.01%
    Total Gross Profit Dollars $20,786,455.46 $20,811,422.60
    Gross Profit Dollar Diff vs Base $24,977.14

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">