Extract Email Address in PDF in PHP using PDF.co Web API
In this tutorial, we will show you how to extract an email address in PDF in PHP using PDF.co Web API. The image below shows the PDF input and the extracted email address in JSON format.
IN THIS TUTORIAL
Step 1: Source Code
Let’s begin by saving the HTML and the PHP code samples in a directory inside the /www or the /htdocs folder.
Step 2: Start Apache Server
Next, start the Apache Server.
Step 3: Run Program
Now, let’s run our program.
- In the address bar, type in
localhost/folder_name/program.html
. - In the API Key field, enter your PDF.co API Key. You can get it in your PDF.co dashboard.
- Load the Input PDF.
- Choose the template file.
Then, click the Proceed button.
Step 4: Result
Great! PDF.co returned a JSON URL where we can view the extracted email address. Simply copy and paste the link to view the result. You can also get the output in CSV or XML format.
In this tutorial, you learned how to extract an email address in a PDF in PHP using PDF.co Web API. You learned how to set up the environment to run a PHP program. You also learned how to extract the email address in other formats.