In this tutorial, we will show you how to convert a quote into CSV in PHP using PDF.co Web API.

  1. PHP and HTML Source Code
  2. Start Apache Server
  3. Run Program
  4. Conversion Result
  5. PDF to CSV Demo

Here’s the source PDF file and converted CSV output.

Source PDF File and Converted CSV Output
Source PDF File and Converted CSV Output

Step 1: PHP and HTML Source Code

To begin, let’s copy the PHP and the HTML source code here. Save it in a folder inside the /www or /htdocs directory depending on whether you are using XAMPP or WampServer.

PHP and HTML Source Code

Step 2: Start Apache Server

Next, start the Apache server in your control panel so we can run the program on our local machine.

Start Apache Server

Step 3: Run Program

Now, let’s run the program.

  • In your browser, type in localhost/Name of folder/HTML file.
  • Next, add your API Key. You can get the API key in your PDF.co dashboard here.
  • Then, input your source PDF file and click the Proceed button to send a request.

Run Program

Step 4: Conversion Result

Great! Our program was a success. Click the temporary URL to view the output.

Conversion Result

Step 5: PDF to CSV Demo

Here’s the PDF to CSV in action.

PDF to CSV Demo
PDF to CSV Demo

In this tutorial, you learned how to convert a quote into CSV using PHP. You learned how to use the PDF.co Web API to convert PDF into CSV. You also learned how to set up the code samples to get the converted output.

Related Pages:

Related Samples: