How to convert PDF to text from URL for PDF to text API in cURL with PDF.co Web API
Learn how to convert PDF to text from URL to have PDF to text API in cURL
Today we will explain the steps and algorithm of how to convert PDF to text from URL and how to make it work in your application. PDF.co Web API was made to help with PDF to text API in cURL. PDF.co Web API is the Rest API that provides set of data extraction functions, tools for documents manipulation, splitting and merging of pdf files. Includes built-in OCR, images recognition, can generate and read barcodes from images, scans and pdf.
You will save a lot of time on writing and testing code as you may just take the code below and use it in your application. Follow the instruction and copy – paste code for cURL into your project’s code editor. Tutorials are available along with installed PDF.co Web API if you’d like to dive deeper into the topic and the details of the API.
PDF.co Web API – free trial version is on available our website. Also, there are other code samples to help you with your cURL application included into trial version.
@echo off :: Path of the cURL executable set CURL="curl.exe" :: The authentication key (API Key). :: Get your own by registering at https://app.pdf.co/documentation/api set API_KEY=*********************************** :: Direct URL of source PDF file. set SOURCE_FILE_URL=https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-to-text/sample.pdf :: Comma-separated list of page indices (or ranges) to process. Leave empty for all pages. Example: '0,2-5,7-'. set PAGES= :: PDF document password. Leave empty for unprotected documents. set PASSWORD= :: Result TXT file name set RESULT_FILE_NAME=result.txt :: Prepare URL for `PDF To Text` API call set QUERY="https://api.pdf.co/v1/pdf/convert/to/text?name=%RESULT_FILE_NAME%&password=%PASSWORD%&pages=%PAGES%&url=%SOURCE_FILE_URL%" :: Perform request and save response to a file %CURL% -# -X GET -H "x-api-key: %API_KEY%" %QUERY% >response.json :: Display the response type response.json :: Use any convenient way to parse JSON response and get URL of generated file(s) echo. pause
ON-PREMISE OFFLINE SDK
ON-DEMAND REST WEB API
Get Your API Key