Click Add External JARs… and select the downloaded JAR.
NetBeans
Right-click Libraries in your project.
Choose Add JAR/Folder… and select the downloaded JAR.
You can place the JAR anywhere in your project (e.g., lib/) and add it to the module/classpath.
3) Compile and run from the command line
Place the JAR under lib/ (or another folder) and use the appropriate classpath separator for your OS.
Windows (CMD/PowerShell):
javac -cp .;lib\groupdocs-metadata-<version>.jar Example.java
java -cp .;lib\groupdocs-metadata-<version>.jar Example path\to\file.pdf
macOS/Linux (bash/zsh):
javac -cp .:lib/groupdocs-metadata-<version>.jar Example.java
java -cp .:lib/groupdocs-metadata-<version>.jar Example /path/to/file.pdf
4) Minimal example to verify the setup
importcom.groupdocs.metadata.Metadata;importcom.groupdocs.metadata.core.FileFormat;importcom.groupdocs.metadata.core.IDocumentInfo;publicclassExample{publicstaticvoidmain(String[]args){if(args.length==0){System.out.println("Usage: java Example <path-to-file>");return;}try(Metadatametadata=newMetadata(args[0])){if(metadata.getFileFormat()!=FileFormat.Unknown){IDocumentInfoinfo=metadata.getDocumentInfo();System.out.println("Format: "+info.getFileType().getFileFormat());System.out.println("Extension: "+info.getFileType().getExtension());System.out.println("Pages: "+info.getPageCount());System.out.println("Size (bytes): "+info.getSize());System.out.println("Encrypted: "+info.isEncrypted());}}}}
5) Licensing (optional)
You can use the library in trial mode with evaluation limitations. To remove limitations, apply a license (file or Metered) in your application according to the Licensing guide.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.