Get file info

With GroupDocs.Watermark you can retrieve the following information about a file:

  • FileType represents the document file type (PDF, Word document, Excel spreadsheet, PowerPoint presentation, image etc.).
  • PageCount represents the number of pages in a document.
  • FileSize represents the document file size.
  • PagesInfo represents the page information.

The following code samples show how to get file information:

Get file info for the file from a local disk

const watermarker = new groupdocs.watermark.Watermarker(documentPath);

const documentInfo = watermarker.getDocumentInfo();
console.log('File type:', documentInfo.getFileType().toString());
console.log('Number of pages:', documentInfo.getPageCount());
console.log('Document size:', documentInfo.getSize(), 'bytes');