Get document 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.Markdown 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-markdown -- dnx GroupDocs.Markdown.Mcp --yes
Folders, licensing and more →

Use getDocumentInfo() or the static getInfo() method to retrieve document metadata without performing a full conversion. This is useful for building file browsers, validation pipelines, and pre-conversion UIs.

Using static method

import com.groupdocs.markdown.*;

public class GetInfoStatic {

    public static void main(String[] args) {
        DocumentInfo info = MarkdownConverter.getInfo("business-plan.docx");

        System.out.println("Format:    " + info.getFileFormat());   // Docx
        System.out.println("Pages:     " + info.getPageCount());    // 42
        System.out.println("Title:     " + info.getTitle());        // "Q3 Report"
        System.out.println("Author:    " + info.getAuthor());       // "Jane Doe"
        System.out.println("Encrypted: " + info.isEncrypted());     // false
    }
}

business-plan.docx is a sample file used in this example. Click here to download it.

Format:    DOCX
Pages:     5
Title:     Meridian Outdoor Co. — Business Plan
Author:    Meridian Outdoor Co.
Encrypted: false

Download full output

Using instance method

import com.groupdocs.markdown.*;

public class GetInfoInstance {

    public static void main(String[] args) {
        try (MarkdownConverter converter = new MarkdownConverter("cost-analysis.xlsx")) {
            DocumentInfo info = converter.getDocumentInfo();

            System.out.println("Format:    " + info.getFileFormat());
            System.out.println("Pages:     " + info.getPageCount());
            System.out.println("Title:     " + info.getTitle());
            System.out.println("Author:    " + info.getAuthor());
            System.out.println("Encrypted: " + info.isEncrypted());
        }
    }
}

cost-analysis.xlsx is a sample file used in this example. Click here to download it.

Format:    XLSX
Pages:     4
Title:     
Author:    
Encrypted: false

Download full output

DocumentInfo methods

MethodReturnsDescription
getFileFormat()FileFormatDetected file format (e.g., FileFormat.DOCX)
getPageCount()intNumber of pages or worksheets
getTitle()StringDocument title from metadata
getAuthor()StringDocument author from metadata
isEncrypted()booleanWhether the document is password-protected