Query PDF

Query PDF

Query PDF is a REST API tool that quickly returns PDF document details, metadata, and other conditional information about the file and its contents, including forms, fonts, security settings, and PDF/A conformance validation.

A bubbling flask with code brackets inside
Try Now with API Lab

Start right from your browser - upload files, choose parameters, generate code, and send API Calls directly from API Lab!  

to receive your free API Key.
Parameters
Required Parameters
POST
/pdf-info
curl -X POST "https://api.pdfrest.com/pdf-info" \ 
  -H "Accept: application/json" \ 
  -H "Content-Type: multipart/form-data" \
  -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
  
Response
The response for your API Call will display here.
Once you've sent your POST request and received a valid response, you can copy your response.

Why is pdfRest the best API to get info from PDF?

pdfRest offers the best solution for checking a PDF for metadata and document information, because it supports conditional processing, PDF/A validation, and over 25 query options with each call.

Drive Conditional Processing

Query PDF pairs well with many other pdfRest API Tools by providing valuable information that can be used to programmatically assess and determine next steps for each document. Some common use cases include:

  • Conditionally split PDFs based on number of pages or file size
  • Convert PDFs to PDF/A only when they are not already conformant to that standard
  • Encrypt files that do not already have security measures applied
  • Confirm PDFs contain the expected content, such as tags, signatures, or forms, before sending them on to their intended audience

Validate PDF/A Conformance

pdfRest's Query PDF validates whether a document successfully conforms to any of the many PDF/A conformance levels. Powered by veraPDF, the industry-standard for PDF/A conformance validation, Query PDF produces results you can depend on. A simple true/false value in the JSON response provides straightforward, actionable information, so you won't waste time trying to parse results from complex reports.

Learn it All with One Call

Return all of the information you need about a PDF and its contents with one API Call. Choose from any of the 25+ query options, and send one API request with your PDF file and comma-separated list of queries. A quick response will return all of the information you requested with easy-to-parse key:value pairs in standard JSON format. All the answers you need without the overhead of complex reports to parse or superfluous data to sift out.

See Customize Your Solution below for more details about all of the supported queries.

Start from Code Examples
  1. First, you'll need an API Key - to:
    • Stay anonymous with a Guest API Key for 10 free API Calls
    • Sign up for an upgraded API Key with unlimited, continuous service
  2. Choose your programming language
  3. Copy and paste the code to your project
  4. Update Api-Key field with your unique API Key
  5. Update file with the local path to your input
  6. Run this code to send an API Call
See more code examples in our
GitHub repository
Try pdfRest with just a few clicks
Download our Postman Postman Collection
Customize Your Solution
Queries
  • tagged
    • Checks for presence of structure tags in the input document.
    • Returns true or false

  • image_only
    • Checks if the document is 'image only' meaning that it will only feature a series of embedded graphical image files, one per page and does not have any text or other features common to PDF documents, except for some metadata.
    • Returns true or false

  • title
    • The title of the PDF as listed in the metadata.
    • Returns a string which may be empty if the document does not have a title

  • subject
    • The subject of the PDF as listed in the metadata.
    • Returns a string which may be empty if the document does not have a subject

  • author
    • The author of the PDF as listed in the metadata.
    • Returns a string which may be empty if the document does not have an author

  • producer
    • The producer of the PDF as listed in the metadata.
    • Returns a string which may be empty if the document does not have a producer

  • creator
    • The creator of the PDF as listed in the metadata.
    • Returns a string which may be empty if the document does not have a creator

  • creation_date
    • The creation date of the PDF as listed in the metadata.
    • Returns a string which may be empty if the document does not have a creation date

  • modified_date
    • The most recent modification date of the PDF as listed in the metadata.
    • Returns a string which may be empty if the document does not have a modification date

  • keywords
    • The keywords of the PDF as listed in the metadata.
    • Returns a string which may be empty if the document does not have keywords

  • doc_language
    • The language that the file claims to be written in.
    • Returns a string

  • page_count
    • The number of pages in the PDF document.
    • Returns an integer

  • contains_annotations
    • Checks whether the document contains annotations, such as notes, highlighted text, file attachments, crossed out text, and text callout boxes.
    • Returns true or false

  • contains_signature
    • Checks if the document contains any digital signatures.
    • Returns true or false

  • pdf_version
    • Retrieves the version of the PDF standard that the document was created with.
    • Returns a string of the form X.Y.Z where X, Y, and Z are the major, minor, and extension versions respectively

  • file_size
    • Retrieves the size of the input file in bytes.
    • Returns an integer

  • filename
    • The name of the input file.
    • Returns a string

  • restrict_permissions_set
    • Checks whether the document has restrict permissions set to prevent printing, copying, signing etc.
    • Returns true or false

  • contains_xfa
    • Checks whether the document contains XFA forms.
    • Returns true or false

  • contains_acroforms
    • Checks whether the document contains Acroforms.
    • Returns true or false

  • contains_javascript
    • Checks whether the document contains javascript.
    • Returns true or false

  • contains_transparency
    • Checks whether the document contains transparent objects.
    • Returns true or false

  • contains_embedded_file
    • Checks whether the document contains one or more embedded files.
    • Returns true or false

  • uses_embedded_fonts
    • Checks whether the document contains fully embedded fonts.
    • Returns true or false

  • uses_nonembedded_fonts
    • Checks whether the document contains non-embedded fonts.
    • Returns true or false

  • pdfa
    • Checks whether the document claims and conforms to a PDF/A standard.
    • Returns true or false

  • requires_password_to_open
    • Checks whether the document requires a password to open.
    • Returns true or false.
    • Note: A document requiring a password cannot be opened by this route and will not be able to return much other information
Generate a self-service API Key now!

Create your FREE API Key to start processing PDFs in seconds, only possible with pdfRest.

Compare Plans
Contact Us