@groupdocs/groupdocs.metadata
v26.7.1
Published
GroupDocs.Metadata is a full featured class library which allows users to read and edit metadata associated with various document, image, audio, video and many other formats. It works with most notable metadata standards: XMP, EXIF, IPTC, Image Resource B
Keywords
Readme
Metadata management API for Node.js (powered by Java) to read, edit, search, compare, replace, and remove metadata from 110+ document, image, audio, video, and other file formats. Works with popular metadata standards including XMP, EXIF, IPTC, Image Resource Blocks, ID3, and format-specific properties.
Quick links
Key Features
- Reading, updating, and removing metadata in a variety of formats.
- Searching, updating, and removing metadata properties that satisfy a specified predicate.
- Using tags to manipulate the most common metadata properties in a unified manner.
- Working with password-protected documents.
- Extracting information about hidden document pages, digital signatures, user comments, revisions, and more.
- Working with popular metadata standards: IPTC, XMP, EXIF, Image Resources.
- Manipulating native metadata properties; extracting technical information from images, audio, and video files.
- Calculating common document statistics (word count, character count, etc.).
- Generating document preview images for UI scenarios.
Supported Formats
This API supports a broad set of document and media formats, including:
- Word Processing: DOC, DOCX, DOCM, ODT, DOT, DOTM
- Spreadsheets: XLS, XLSX, XLSM, ODS, XLSB, XLT
- Presentations: PPT, PPTX, PPS, PPSX, POT, POTM
- PDF: PDF
- Images: JPG, PNG, TIFF, BMP, GIF, PSD
- Audio/Video: MP3, WAV, OGG, AVI, MOV, MKV, ASF, FLV, MK3D
- Archives/Fonts: ZIP, 7Z, CB7, CBR, CBT, CBZ, OTF, TTF, OTC, TTC
Supports 110+ formats. For the full list, see: https://docs.groupdocs.com/metadata/nodejs-java/supported-document-formats/
Getting Started
Prerequisites
- Node.js (LTS recommended)
- Java Runtime Environment (JRE) 8 or later
- Windows, Linux, or macOS
Installation
Install the package from npm:
npm i @groupdocs/groupdocs.metadataFor detailed setup instructions, see the System Requirements and Installation documentation topics.
Use cases
Below are simple Node.js snippets that demonstrate typical use cases.
Remove all recognized metadata
This code example shows how to remove all detected metadata packages/properties from a file using sanitize.
const gMeta = require('@groupdocs/groupdocs.metadata')
// Apply license if you have one (optional for evaluation)
const license = new gMeta.License()
license.setLicense('GroupDocs.Metadata.lic')
const metadata = new gMeta.Metadata('input.pdf')
const affected = metadata.sanitize()
console.log(`Properties removed: ${affected}`)
metadata.save('output.pdf')
process.exit(0)Find common metadata properties using tags
This code example shows how to search for properties by tags without knowing the exact file format structure.
const gMeta = require('@groupdocs/groupdocs.metadata')
// Apply license if you have one (optional for evaluation)
const license = new gMeta.License()
license.setLicense('GroupDocs.Metadata.lic')
const metadata = new gMeta.Metadata('source.pptx')
// Fetch properties: last document editor OR last modified date/time
const searchSpecification = new gMeta.ContainsTagSpecification(
gMeta.Tags.getPerson().getEditor()
).or(
new gMeta.ContainsTagSpecification(
gMeta.Tags.getTime().getModified()
)
)
const properties = metadata.findProperties(searchSpecification)
for (let i = 0; i < properties.getCount(); i++) {
const property = properties.get_Item(i)
console.log(
`Property name: ${property.getName()}, Property value: ${property.getValue()}`
)
}
process.exit(0)Get document info
This code example shows how to read basic file information (format, MIME type, page count, encryption status).
const gMeta = require('@groupdocs/groupdocs.metadata')
// Apply license if you have one (optional for evaluation)
const license = new gMeta.License()
license.setLicense('GroupDocs.Metadata.lic')
const metadata = new gMeta.Metadata('source.xlsx')
if (metadata.getFileFormat() !== gMeta.FileFormat.Unknown) {
const info = metadata.getDocumentInfo()
console.log(`File format: ${info.getFileType().getFileFormat()}`)
console.log(`File extension: ${info.getFileType().getExtension()}`)
console.log(`MIME Type: ${info.getFileType().getMimeType()}`)
console.log(`Number of pages: ${info.getPageCount()}`)
console.log(`Document size: ${info.getSize()} bytes`)
console.log(`Is document encrypted: ${info.isEncrypted()}`)
}
process.exit(0)Troubleshooting
- Download during installation fails (corporate proxy/firewall): Ensure your environment allows downloading the required JAR during
postinstall. If needed, download the file manually to thelib/directory as described in the Installation Guide. - Java not found: Make sure Java (JRE 8+) is installed and available on your system
PATH. - Permission issues when writing output files: Verify your process has write access to the target directory.
Licensing
For testing without trial limitations, you can request a 30-day Temporary License:
- Visit the Get a Temporary License page
- Login with your company email address
- Request a temporary license and get it in your mailbox
After you receive the license file, save it locally and use it in your application as follows:
const { License } = require('@groupdocs/groupdocs.metadata')
// Apply license
const license = new License()
license.setLicense('GroupDocs.Metadata.lic')This product is licensed under the GroupDocs End User License Agreement (EULA). For pricing information, visit the GroupDocs.Metadata for Node.js via Java pricing page.
Support
GroupDocs provides unlimited free technical support for all of its products. Support is available to all users, including evaluation. The support is provided at Free Support Forum, Paid Support Helpdesk and Paid Consulting.
Free Support Forum
The GroupDocs Free Support Forum is available to all users and provides:
- Human support by the product team
- No time limitations on support requests
- Access to historical solutions and discussions
Paid Support Helpdesk
The Paid Support Helpdesk offers:
- Higher priority response times
- Dedicated support team
- Extended support hours
- Priority issue resolution
Paid Consulting
We can work together with you on your project and develop a part or complete application. If you need new features in the existing GroupDocs product or to create API for new file formats, send us a request at consulting.groupdocs.com/contact.
| Product Home | Documentation | Blog | API Reference | Code Samples | Free Support | Temporary License | Pricing |
