Skip to main content

pdf-text


Use the pdf-text endpoint to extract text from a PDF.


Use the pdf-text endpoint to extract text from a PDF. It uses an HTTP POST to send a PDF as binary and then returns the extracted text as a JSON response. The pdf-text endpoint takes an HTTP POST form submission, where the PDF is sent as binary in the form's body.

POST https://api.dynamicpdf.com/v1.0/pdf-text HTTP/1.1Authorization: Bearer your-api-key
info

Refer to pdf-text in the Client Libraries Users Guide section for this example using the DynamicPDF Cloud API's client libraries.

Parameters#

The endpoint takes two optional query parameters, startPage and pageCount.

Query ParameterTypeDescriptionRequired
startPageintegerThe page to start extracting text.
pageCountintegerThe number of pages to extract text.
Request BodyType
BodybinaryThe PDF document to send to the endpoint.✔️
Header ParameterValue
Content-Typeapplication/pdfContent type sent in request.
AuthorizationBearer DP.V9xxxxxxxxxxxxxxxThe API key.✔️

Example cURL Request#

curl -X POST "https://api.dynamicpdf.com/v1.0/pdf-text?startPage=1&pageCount=2"-H  "accept: application/json"-H  "Authorization: Bearer DP.V9xxxxxxxxxxxxxxxxxxxxxxxxxxxx"-H  "Content-Type: application/pdf"--data-binary "@c:/holding/pdf-text/fw4.pdf"

Example Response#

[    {        "pageNumber": 1,        "text": "[DynamicPDF Evaluation] Form  W-4\n(Rev. December 2020)\nDepartment of the Treasury  \nInternal Revenue Service \nEmployee’s Withholding Certificate\n ▶  Complete Form W-4 so that your employer can withhold the correct federal  income tax from your pay. \n ▶  Give Form W-4 to your empl ....[Text Truncated - Please purchase a license or contact support for an evaluation license.]"    },    {        "pageNumber": 2,        "text": "[DynamicPDF Evaluation] Form W-4 (2021) Page 2\nGeneral Instructions\nFuture Developments\nFor the latest information about developments related to \nForm W-4, such as legislation enacted after it was published, \ngo to www.irs.gov/FormW4 .\nPurpose of Form\nComplete Form W-4 so that yo ....[Text Truncated - Please purchase a license or contact support for an evaluation license.]"    }]

Further Information#

You can also use one of DynamicPDF's provided client libraries to integrate the endpoints into your client applications if you prefer. For more information, refer to the relevant Users Guide sections: