In this tutorial, we will show you how to extract specific text from a Quote using PDF.co and PHP.
Here’s the image of our sample Quote.

And here’s the JSON output.

Step 1 – Source Code
First, let’s copy the PHP and the HTML source code here. Save the files in a folder inside the /www or /htdocs directory depending on whether you are using XAMPP or WampServer.
Step 2 – Start Apache Server
Next, start the Apache server so we can run the program on our local machine.
Step 3 – Run Program
Now, let’s run the program.
- Open your browser and type in localhost/Name of your folder/HTML file e.g.,
localhost/documentparser/program.html
- In the API Key field, add your API Key. You can get the API key in your PDF.co dashboard here.
- Click on the Choose File button to load your source PDF file.
- And then, choose and open your template in JSON or YML format.
- Now, click on the Proceed button to process your request.
To learn more about Document Parser, please visit this page.
Step 4 – Document Parser Result
Great! PDF.co successfully processed our request. Click on the output link to view the result.
Step 5 – Demo
Here’s the Quote Parser in action.

In this tutorial, you learned how to parse specific text in a Quote using PDF.co and PHP. You learned how to run the source code samples. You also learned how to convert the Quote into JSON format.