# Get file info This article explains the ability of the GroupDocs.Redaction API to get the general document information, which includes FileType, PageCount and FileSize. ### Get file info GroupDocs.Redaction provides general document information, which includes: * FileType * PageCount * FileSize The following code examples demonstrate how to get document information. ### Get file info for a file from local disk {{< tabs "code-example-get-local-file-info" >}} {{< tab "get_local_file_info.js" >}} ```js const redaction = require('@groupdocs/groupdocs.redaction'); const redactor = new redaction.Redactor(stream); try { const info = redactor.getDocumentInfo(); console.log('\nFile type: ' + info.getFileType() + '\nNumber of pages: ' + info.getPageCount() + '\nDocument size: ' + info.getSize() + ' bytes'); } finally { redactor.close(); } ``` {{< /tab >}} {{< tab "sample.docx" >}} {{< tab-text >}} `sample.docx` is the sample file used in this example. Click [here](https://docs.groupdocs.com/redaction/nodejs-java/_sample_files/developer-guide/basic-usage/get-file-info/sample.docx) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "code-example-get-local-file-info.txt" >}} ```text File type: Microsoft Word Open XML Document (.docx) Number of pages: 1 Document size: 19370 bytes ``` [Download full output](https://docs.groupdocs.com/redaction/nodejs-java/_output_files/developer-guide/basic-usage/get-file-info/CodeExampleGetLocalFileInfo/code-example-get-local-file-info.txt) {{< /tab >}} {{< /tabs >}} ### Get file info for a file from Stream {{< tabs "code-example-get-file-info-from-stream" >}} {{< tab "get_file_info_from_stream.js" >}} ```js const redaction = require('@groupdocs/groupdocs.redaction'); const java = require('java'); const FileInputStream = java.import('java.io.FileInputStream'); const stream = new FileInputStream('sample.docx'); const redactor = new redaction.Redactor(stream); try { const info = redactor.getDocumentInfo(); console.log('\nFile type: ' + info.getFileType() + '\nNumber of pages: ' + info.getPageCount() + '\nDocument size: ' + info.getSize() + ' bytes'); } finally { redactor.close(); stream.close(); } ``` {{< /tab >}} {{< tab "sample.docx" >}} {{< tab-text >}} `sample.docx` is the sample file used in this example. Click [here](https://docs.groupdocs.com/redaction/nodejs-java/_sample_files/developer-guide/basic-usage/get-file-info/sample.docx) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "code-example-get-file-info-from-stream.txt" >}} ```text File type: Microsoft Word Open XML Document (.docx) Number of pages: 1 Document size: 19370 bytes ``` [Download full output](https://docs.groupdocs.com/redaction/nodejs-java/_output_files/developer-guide/basic-usage/get-file-info/CodeExampleGetFileInfoFromStream/code-example-get-file-info-from-stream.txt) {{< /tab >}} {{< /tabs >}}