optimizePDF

Reduces the size of a PDF file and returns its content using the Base64 encoding.

The function can process either the path to a PDF file saved on the server or the actual file content encoded using the Base64 scheme.

The resulting optimized PDF is based on a number of modifications, such as:

Syntax

Copy
function optimizePDF(source: string): string;
 
Parameter Description
source Either:
  • The Base64 string representation of a PDF file.
  • The name of a PDF file saved in the file upload location.

Return Value

Returns a string value that contains the optimized file encoded using the Base64 scheme.

Examples