Get file info

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Watermark MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-watermark -- dnx GroupDocs.Watermark.Mcp --yes
Folders, licensing and more →

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');