Select a product

PDF.js Express Free Viewerplay_arrow

Professional PDF.js Viewing - Free

PDF.js Express Plusplay_arrow

Professional PDF.js Viewing & Annotations - Try for free

Get Started

play_arrow

Learn more

play_arrow

Common use cases

play_arrow

Open a document

play_arrow

Save a document

play_arrow

Viewer

play_arrow

UI Customization

play_arrow

Annotations

play_arrow

Collaboration

play_arrow

Forms

play_arrow

Signature

play_arrow

Searching

play_arrow

Measurement

play_arrow

Compare

play_arrow

Advanced Capabilities

play_arrow

PDF.js Express REST API

play_arrow

Migration Guides

play_arrow

Delete a processed file

The following features are available in:

check

PDF.js Express Viewer

help_outline

PDF.js Express Viewer is a free viewer that has limited capabilities compared to PDF.js Express Pro

check

PDF.js Express Plus

help_outline

PDF.js Express Plus is a paid product that supports annotating, signing, form filling and more

This endpoint deleted a stored processed file from PDF.js Express servers.

If this endpoint is not called, the file will be deleted in 24 hrs.

NOTE: It is strongly recommended to use the Rest API Utility package

Calling this endpoint does not count as an action.

Endpoint

POST https://api.pdfjs.express/delete

Body params

The request body must be formatted as multipart/form-data

NameTypeDescription
idstringThe id of the file, retrieved from the response of other endpoints.
licensestringYour PDF.js Express API license key. You must pass the correct license key depending if you are making the request from the server or the client. If no license key is provided, the output will be watermarked and usage will be heavily limited.

Response body (success)

A success response will come back in json format and will contain the following:

PropertyTypeDescription
idstringThe ID of the deleted file
messagestringA message from the server

Response body (error)

See the list of error responses for details.

Example

The following example creates a function that can be used to delete a file.

const deleteFile = async (id) => {
    const data = new FormData();
    data.append('id', id);
    data.append('license', my_license_key);

    // Process the file
    const response = await fetch('https://api.pdfjs.express/delete', {
      method: 'post',
      body: data
    }).then(resp => resp.json());

    // do something after...
}