### Automated Installation Output Example
Source: https://docs.verapdf.org/install
This is a sample of the output you can expect when running the automated installation process for veraPDF.
```text
Command line arguments: auto-install.xml
[ Starting automated installation ]
====================
Installation started
Framework: 5.1.3-84aaf (IzPack)
Platform: linux,version=6.1.27-gentoo-r1-x86_64,arch=x64,symbolicName=null,javaVersion=17.0.8.1
[ Starting to unpack ]
[ Processing package: veraPDF GUI (1/3) ]
Cleaning up the target folder ...
[ Processing package: veraPDF Mac and *nix Scripts (2/3) ]
Cleaning up the target folder ...
[ Processing package: veraPDF Documentation (3/3) ]
Cleaning up the target folder ...
[ Unpacking finished ]
Installation finished
[ Writing the uninstaller data ... ]
[ Automated installation done ]
```
--------------------------------
### Command Line for Automated Installation
Source: https://docs.verapdf.org/install
Use this command to invoke the veraPDF installer with an XML configuration file. Windows users should use 'vera-install.bat'.
```bash
./verapdf-install ./auto-install.xml
```
--------------------------------
### Batch Summary Example
Source: https://docs.verapdf.org/cli/validation
An example of a batch summary output, indicating the total number of jobs processed, failures, and the total duration of the validation process.
```xml
15260000:01:39:888
```
--------------------------------
### veraPDF Automated Installation Configuration
Source: https://docs.verapdf.org/install
This XML file configures the automated installation of veraPDF, specifying installation directory and selected components.
```xml
/tmp/verapdf-test
```
--------------------------------
### Single Plugin Configuration in plugins.xml
Source: https://docs.verapdf.org/cli/config
An example of `plugins.xml` with a single plugin enabled. This configuration specifies the plugin's name, version, description, JAR path, and custom attributes.
```xml
Plugin Name1.0.1Some plugin descriptionpluginPath/plugin.jar
```
--------------------------------
### Check veraPDF version on Linux
Source: https://docs.verapdf.org/cli/terminal
Verify the installed version of veraPDF on Linux.
```bash
cfw@dm-wrkstn:~/verapdf$ ./verapdf --version
veraPDF 1.28.2
Built: Fri Jan 13 11:30:00 GMT 2023
Developed and released by the veraPDF Consortium.
Funded by the PREFORMA project.
Released under the GNU General Public License v3
and the Mozilla Public License v2 or later.
```
--------------------------------
### Integrate veraPDF Processor API
Source: https://docs.verapdf.org/develop/processor
This example demonstrates initializing the veraPDF foundry, configuring the validator, feature extractor, plugins, and metadata fixer, and then processing a list of files. It includes error handling for processing and closing streams.
```java
public static void main(String[] args) {
// Foundry initialising. Can be changed into PDFBox based one
VeraGreenfieldFoundryProvider.initialise();
// Default validator config
ValidatorConfig validatorConfig = ValidatorFactory.defaultConfig();
// or it is possible to specify required parameters using ValidatorConfigBuilder. For example, to specify a validation flavour explicitly:
// ValidatorConfig validatorConfig = new ValidatorConfigBuilder().flavour(PDFAFlavour.PDFA_4).build();
// Default features config
FeatureExtractorConfig featureConfig = FeatureFactory.defaultConfig();
// Default plugins config
PluginsCollectionConfig pluginsConfig = PluginsCollectionConfig.defaultConfig();
// Default fixer config
MetadataFixerConfig fixerConfig = FixerFactory.defaultConfig();
// Tasks configuring
EnumSet tasks = EnumSet.noneOf(TaskType.class);
tasks.add(TaskType.VALIDATE);
tasks.add(TaskType.EXTRACT_FEATURES);
tasks.add(TaskType.FIX_METADATA);
// Creating processor config
ProcessorConfig processorConfig = ProcessorFactory.fromValues(validatorConfig, featureConfig, pluginsConfig, fixerConfig, tasks);
// Creating processor and output stream. In this example output stream is System.out
try (BatchProcessor processor = ProcessorFactory.fileBatchProcessor(processorConfig);
OutputStream reportStream = System.out) {
// Generating list of files for processing
List files = new ArrayList<>();
files.add(new File("location/file.pdf"));
// starting the processor
processor.process(files, ProcessorFactory.getHandler(FormatOption.MRR, true, reportStream,
The veraPDF Processor API is the main entry point for integrating the veraPDF project into another one. This example shows how to initialize the necessary components and process a list of PDF files for validation, feature extraction, and metadata fixing. It covers the configuration of various aspects of the processor, including validator settings, feature extraction, plugins, and metadata fixing, as well as the selection of tasks to perform. The example also demonstrates how to create a batch processor and handle potential exceptions during the processing and stream closing operations. The primary language used is Java.
```
--------------------------------
### Navigate to the veraPDF directory on Windows
Source: https://docs.verapdf.org/cli/terminal
Change the current working directory to the default veraPDF installation folder.
```bash
C:\Users\cfw>cd verapdf
C:\Users\cfw\verapdf>
```
--------------------------------
### Check veraPDF version on Windows
Source: https://docs.verapdf.org/cli/terminal
Verify the installed version of veraPDF using the batch script.
```bash
C:\Users\cfw\verapdf>verapdf.bat --version
veraPDF 1.28.2
Built: Fri Jan 13 11:30:00 GMT 2023
Developed and released by the veraPDF Consortium.
Funded by the PREFORMA project.
Released under the GNU General Public License v3
and the Mozilla Public License v2 or later.
```
--------------------------------
### Font Feature Report Output
Source: https://docs.verapdf.org/cli/feature-extraction
Example of the XML report generated after running the extraction command.
```xml
/home/cfw/verapdf/dev/corpus/veraPDF-corpus-staging/PDF_A-1b/6.3 Fonts/6.3.6 Font metrics/veraPDF test suite 6-3-6-t01-pass-a.pdfTrueTypeSVIUCJ+TimesNewRomanPSMT
32121...WinAnsiEncodingSVIUCJ+TimesNewRomanPSMTTimes New RomanNormal400.0falsetruefalsetruefalsefalsefalsefalse0.01007.0-307.00.0662.0448.080.00.00.00.00.0true00:00:00:41301000:00:00:519
```
--------------------------------
### Navigate to the veraPDF directory on Linux
Source: https://docs.verapdf.org/cli/terminal
Change the current working directory to the default veraPDF installation folder on Linux.
```bash
cfw@dm-wrkstn:~$ cd verapdf
cfw@dm-wrkstn:~/verapdf$
```
--------------------------------
### Information Dictionary XML Structure
Source: https://docs.verapdf.org/policy
Example of the XML structure for Information Dictionary metadata entries.
```xml
Test titleveraPDF ConsortiumTest descriptionTEST KEYWORDSveraPDF Test BuilderveraPDF Test Builder 1.0 2015-03-10T17:19:21.000+01:002015-03-10T17:19:21.000+01:00
```
--------------------------------
### Check veraPDF version on Mac OS
Source: https://docs.verapdf.org/cli/terminal
Verify the installed version of veraPDF on macOS.
```bash
dm-macmini:verapdf cfw$ ./verapdf --version
veraPDF 1.28.2
Built: Fri Jan 13 11:30:00 GMT 2023
Developed and released by the veraPDF Consortium.
Funded by the PREFORMA project.
Released under the GNU General Public License v3
and the Mozilla Public License v2 or later.
```
--------------------------------
### Validate PDF with Specific Profile
Source: https://docs.verapdf.org/cli/validation
Specify a validation profile using the `-f` or `--flavour` option followed by the profile code. This example validates a PDF/A-1b file.
```bash
verapdf -f 1b corpus/veraPDF-corpus-staging/PDF_A-1b/6.6\ Actions/6.6.1\ General/veraPDF\ test\ suite\ 6-6-1-t02-pass-a.pdf
```
--------------------------------
### Example feature extraction output
Source: https://docs.verapdf.org/cli/feature-extraction
Sample XML output generated by the veraPDF feature extractor.
```xml
/home/cfw/verapdf/dev/adobe_supplement_iso32000.pdfAcrobat Supplement to the ISO 32000Adobe Developer SupportAdobe Acrobat 9.0 SDKFrameMaker 7.2Acrobat Distiller 9.0.0 (Windows)2008-05-22T15:17:22.000Z2008-05-29T17:07:38.000-07:0000:00:00:053000:00:00:449
```
--------------------------------
### veraPDF Validation Report Example
Source: https://docs.verapdf.org/cli/validation
An example of the XML report generated by veraPDF after validating a PDF file. The `isCompliant` attribute in the `` tag indicates the validation result.
```xml
/home/cfw/verapdf/dev/corpus/veraPDF-corpus-staging/PDF_A-1b/6.6 Actions/6.6.1 General/veraPDF test suite 6-6-1-t02-pass-a.pdf00:00:00:39310000:00:00:462
```
--------------------------------
### Policy report output for passed checks
Source: https://docs.verapdf.org/policy
Example of a machine-readable policy report indicating successful font checks.
```xml
Adobe Gothic should be present.Adobe Gothic should be present.
```
--------------------------------
### Navigate to the veraPDF directory on Mac OS
Source: https://docs.verapdf.org/cli/terminal
Change the current working directory to the default veraPDF installation folder on macOS.
```bash
dm-macmini:~ cfw$ cd verapdf
dm-macmini:verapdf cfw$
```
--------------------------------
### Policy report output for failed checks
Source: https://docs.verapdf.org/policy
Example of a machine-readable policy report indicating failed font checks.
```xml
Adobe Gothic Bold fonts are not allowed.Adobe Gothic Bold fonts are not allowed.
```
--------------------------------
### Example XML validation report
Source: https://docs.verapdf.org/cli/validation
The output format generated by veraPDF when validating a document, showing build information, job details, and specific rule failures.
```xml
/home/cfw/verapdf/dev/corpus/veraPDF-corpus-staging/PDF_A-1b/6.6 Actions/6.6.1 General/veraPDF test suite 6-6-1-t01-fail-a.pdfThe Launch, Sound, Movie, ResetForm, ImportData and JavaScript actions shall not be permitted.
Additionally, the deprecated set-state and no-op actions shall not be permitted. The Hide action shall not be permitted (Corrigendum 2)S == "GoTo" || S == "GoToR" || S == "Thread" || S == "URI" || S == "Named" || S == "SubmitForm"root/document[0]/OpenAction[0](5 0 obj PDAction)00:00:00:50010000:00:00:638
```
--------------------------------
### List configuration files on Windows
Source: https://docs.verapdf.org/cli/config
Displays the contents of the veraPDF configuration directory on a Windows system.
```bash
C:\Users\cfw\verapdf>dir config
Volume in drive C has no label.
Volume Serial Number is 1C45-2074
Directory of C:\Users\cfw\verapdf\config
22/01/2023 12:44 .
22/01/2023 12:44 ..
22/01/2023 12:44 411 app.xml
22/01/2023 12:44 186 features.xml
22/01/2023 12:44 109 fixer.xml
22/01/2023 12:44 131 validator.xml
4 File(s) 837 bytes
2 Dir(s) 3,695,038,464 bytes free
```
--------------------------------
### Clone and Build Greenfield Project
Source: https://docs.verapdf.org/develop
Clone the veraPDF consortium's greenfield implementation from GitHub and build it using git and Maven.
```bash
git clone https://github.com/veraPDF/veraPDF-validation.git
cd veraPDF-validation
mvn clean install
```
--------------------------------
### Clone and Build PDFBox Project
Source: https://docs.verapdf.org/develop
Clone the PDFBox implementation of veraPDF from GitHub and build it using git and Maven.
```bash
git clone https://github.com/veraPDF/veraPDF-pdfbox-validation.git
cd veraPDF-pdfbox-validation
mvn clean install
```
--------------------------------
### Empty plugins.xml Configuration
Source: https://docs.verapdf.org/cli/config
The default `config/plugins.xml` file contains an empty entry, serving as a base for adding plugin configurations.
```xml
```
--------------------------------
### Initialize Greenfield Foundry
Source: https://docs.verapdf.org/develop
Initialize the veraPDF library's Greenfield foundry before first use. Ensure necessary imports are included.
```java
import org.verapdf.core.EncryptedPdfException;
import org.verapdf.core.ModelParsingException;
import org.verapdf.core.ValidationException;
import org.verapdf.gf.foundry.VeraGreenfieldFoundryProvider;
import org.verapdf.pdfa.Foundries;
import org.verapdf.pdfa.PDFAParser;
import org.verapdf.pdfa.results.ValidationResult;
import org.verapdf.pdfa.PDFAValidator;
import org.verapdf.pdfa.flavours.PDFAFlavour;
VeraGreenfieldFoundryProvider.initialise();
```
--------------------------------
### Initialize PDFBox Foundry
Source: https://docs.verapdf.org/develop
Initialize the veraPDF library's PDFBox foundry before first use. Ensure necessary imports are included.
```java
import org.verapdf.core.EncryptedPdfException;
import org.verapdf.core.ModelParsingException;
import org.verapdf.core.ValidationException;
import org.verapdf.pdfbox.foundry.PdfBoxFoundryProvider;
import org.verapdf.pdfa.Foundries;
import org.verapdf.pdfa.PDFAParser;
import org.verapdf.pdfa.results.ValidationResult;
import org.verapdf.pdfa.PDFAValidator;
import org.verapdf.pdfa.flavours.PDFAFlavour;
PdfBoxFoundryProvider.initialise();
```
--------------------------------
### Execute veraPDF policy check
Source: https://docs.verapdf.org/policy
Command line execution of a Schematron policy file against a target PDF file.
```bash
verapdf --policyfile font-disallowed.sch corpus/veraPDF-corpus-staging/PDF_A-1b/6.3\ Fonts/6.3.3.1\ General/veraPDF\ test\ suite\ 6-3-3-1-t01-pass-a.pdf
```
```bash
verapdf --policyfile single-font.sch corpus/veraPDF-corpus-staging/PDF_A-1b/6.3\ Fonts/6.3.3.1\ General/veraPDF\ test\ suite\ 6-3-3-1-t01-pass-a.pdf
```
--------------------------------
### Locate configuration files
Source: https://docs.verapdf.org/cli/config
Command to identify the file system path where veraPDF configuration files are stored.
```bash
verapdf --config
```
```text
CONFIG: Config location: C:\Users\\AppData\Roaming\verapdf\config
```
--------------------------------
### Specify Wiki Path
Source: https://docs.verapdf.org/cli/validation
Point to a local version of the veraPDF validation rule wiki. This is typically used if you are hosting your own wiki.
```bash
verapdf --wikiPath /path/to/local/wiki ...
```
--------------------------------
### Configure Image Feature Extraction
Source: https://docs.verapdf.org/cli/feature-extraction
Enable the IMAGE_XOBJECT feature by updating the features.xml configuration file.
```xml
IMAGE_XOBJECT
```
--------------------------------
### Default application configuration
Source: https://docs.verapdf.org/cli/config
The standard XML structure for the veraPDF application configuration file.
```xml
https://github.com/veraPDF/veraPDF-validation-profiles/wiki/
```
--------------------------------
### Set default validation flavour
Source: https://docs.verapdf.org/cli/validation
Use the --defaultflavour or -df option to specify a fallback profile when XMP metadata is missing or invalid.
```bash
verapdf --defaultflavour 2b test.pdf
```
--------------------------------
### Extract XMP Metadata with VeraPDF
Source: https://docs.verapdf.org/cli/feature-extraction
Execute the verapdf command with the --extract option to process a PDF and output its XMP metadata.
```bash
verapdf --off --extract adobe_supplement_iso32000.pdf
```
--------------------------------
### List veraPDF Validation Profiles
Source: https://docs.verapdf.org/cli/validation
Use the `-l` or `--list` command to display all supported PDF/A and PDF/UA validation profiles. This command is available on all platforms.
```bash
verapdf -l
```
```bash
verapdf.bat --list
```
--------------------------------
### List available feature extraction options
Source: https://docs.verapdf.org/cli/feature-extraction
The complete set of features available for the --extract CLI option.
```text
actions, annotations, colorSpace, ds, embeddedFile, exGSt, font, formXobject, iccProfile, imageXobject, informationDict, interactiveFormField, lowLevelInfo, metadata, outlines, outputIntent, page, pattern, postscriptXobject, properties, shading, signature
```
--------------------------------
### Configure features.xml for Information Dictionary
Source: https://docs.verapdf.org/cli/feature-extraction
Edit the features.xml file to enable only the INFORMATION_DICTIONARY feature for extraction.
```xml
INFORMATION_DICTIONARY
```
--------------------------------
### Enable All Feature Extraction
Source: https://docs.verapdf.org/cli/config
Configure the `features.xml` file to enable the extraction of all available PDF features. Add each desired feature as a separate `` sub-element.
```xml
ACTIONANNOTATIONCOLORSPACEDOCUMENT_SECURITYEMBEDDED_FILEEXT_G_STATEFONTFORM_XOBJECTICCPROFILEIMAGE_XOBJECTINFORMATION_DICTIONARYINTERACTIVE_FORM_FIELDSLOW_LEVEL_INFOMETADATAOUTLINESOUTPUTINTENTPAGEPATTERNPOSTSCRIPT_XOBJECTPROPERTIESSHADINGSIGNATURE
```
--------------------------------
### Validate against a custom profile
Source: https://docs.verapdf.org/cli/validation
Use the --profile or -p option to validate a PDF file against a specific custom XML profile.
```bash
verapdf --profile profile.xml test.pdf
```
--------------------------------
### Configure Font Feature Extraction
Source: https://docs.verapdf.org/cli/feature-extraction
Update the features.xml file to enable the FONT feature.
```xml
FONT
```
--------------------------------
### Validate encrypted PDF with password
Source: https://docs.verapdf.org/cli/validation
Provide a password for encrypted PDF files using the --password flag.
```bash
verapdf --password "12345" encrypted.pdf
```
--------------------------------
### Enable Information Dictionary Feature Extraction
Source: https://docs.verapdf.org/cli/config
Configure the `features.xml` file to enable the extraction of PDF document metadata from the information dictionary. This is the default setting.
```xml
INFORMATION_DICTIONARY
```
--------------------------------
### Add veraPDF to Windows PATH
Source: https://docs.verapdf.org/cli/terminal
Update the PATH environment variable to allow running veraPDF from any directory.
```bash
C:\Users\cfw>set PATH=%PATH%;C:\Users\cfw\verapdf
C:\Users\cfw>
```
--------------------------------
### VeraPDF XMP Metadata Extraction Output
Source: https://docs.verapdf.org/cli/feature-extraction
The output shows the extracted XMP metadata in XML format, including build information and job details.
```xml
/home/cfw/verapdf/dev/adobe_supplement_iso32000.pdfFrameMaker 7.22008-05-29T17:07:38-07:002008-05-22T15:17:22Z2008-05-29T17:07:38-07:00application/pdfAcrobat Supplement to the ISO 32000Adobe Developer SupportAdobe Acrobat 9.0 SDKAcrobat Distiller 9.0.0 (Windows)uuid:d5b217b3-93ee-471c-8fa0-e427ef138e39uuid:4642285f-19a7-4222-985a-a056fd98cd1d00:00:00:03801000:00:00:405
```
--------------------------------
### Execute veraPDF Extraction Command
Source: https://docs.verapdf.org/cli/feature-extraction
Run the veraPDF command-line tool to extract features from a specific PDF file.
```bash
verapdf --off --extract corpus/veraPDF-corpus-staging/PDF_A-1b/6.2\ Graphics/6.2.4\ Images/veraPDF\ test\ suite\ 6-2-4-t03-pass-a.pdf
```
--------------------------------
### Execute veraPDF Extraction Command
Source: https://docs.verapdf.org/cli/feature-extraction
Run the veraPDF command-line tool to extract features from a specific PDF file.
```bash
verapdf --off --extract corpus/veraPDF-corpus-staging/PDF_A-1b/6.3 Fonts/6.3.6 Font metrics/veraPDF test suite 6-3-6-t01-pass-a.pdf
```
--------------------------------
### Validate with automatic flavour detection
Source: https://docs.verapdf.org/cli/validation
Use the -f 0 or --flavour 0 option to allow veraPDF to automatically select the appropriate profile based on document metadata.
```bash
verapdf -f 0 corpus/veraPDF-corpus-staging/PDF_A-1b/6.6\ Actions/6.6.1\ General/veraPDF\ test\ suite\ 6-6-1-t0 veraPDF test suite 6-6-1-t01-fail-a.pdf veraPDF test suite 6-6-1-t02-pass-a.pdf
```
```bash
verapdf corpus/veraPDF-corpus-staging/PDF_A-1b/6.6\ Actions/6.6.1\ General/veraPDF\ test\ suite\ 6-6-1-t0 veraPDF test suite 6-6-1-t01-fail-a.pdf
```
--------------------------------
### Add Greenfield Jakarta Dependency
Source: https://docs.verapdf.org/develop
Use this Maven dependency for the Greenfield implementation if your project uses Jakarta instead of javax.
```xml
org.verapdfvalidation-model-jakarta1.28.1
```
--------------------------------
### Enable METADATA Feature in VeraPDF
Source: https://docs.verapdf.org/cli/feature-extraction
Modify the features.xml configuration file to enable the METADATA feature before running VeraPDF.
```xml
METADATA
```
--------------------------------
### Add PDFBox Jakarta Dependency
Source: https://docs.verapdf.org/develop
Use this Maven dependency for the PDFBox implementation if your project uses Jakarta instead of javax.
```xml
org.verapdfpdfbox-validation-model-jakarta1.28.1
```
--------------------------------
### Specify Report Format
Source: https://docs.verapdf.org/cli/validation
Control the output format of the validation report. Available formats include 'text', 'raw', 'html', and 'json'.
```bash
verapdf --format text ...
verapdf --format raw ...
verapdf --format html ...
verapdf --format json ...
```
--------------------------------
### Validate Files with Non-PDF Extensions
Source: https://docs.verapdf.org/cli/validation
Process files that may have a non-standard extension but are actually PDF documents. Use this option when dealing with files that do not have a '.pdf' extension.
```bash
verapdf somefile --nonpdfext
```
--------------------------------
### Schematron Schema for Compression Check
Source: https://docs.verapdf.org/policy
This Schematron schema defines rules to check for specific compression types used in a PDF document's report. It includes both assertions for required compressions and reports for allowed ones.
```xml
CCITT compression is OKJPEG compression is not OK
```
--------------------------------
### Validate PDF against multiple detected flavours
Source: https://docs.verapdf.org/develop
Extracts all conformance declarations from a PDF and validates against specific families like PDF/A and PDF/UA.
```java
VeraGreenfieldFoundryProvider.initialise();
try (PDFAParser parser = Foundries.defaultInstance().createParser(new FileInputStream("mydoc.pdf"))) {
List detectedFlavours = parser.getFlavours();
List flavours = new LinkedList<>();
for (PDFAFlavour flavour : detectedFlavours) {
// iterate through all detected flavours and pick up PDF/A and PDF/UA ones for validation
if (PDFFlavours.isFlavourFamily(flavour, PDFAFlavour.SpecificationFamily.PDF_A) ||
PDFFlavours.isFlavourFamily(flavour, PDFAFlavour.SpecificationFamily.PDF_UA)) {
flavours.add(flavour);
}
}
PDFAValidator validator = Foundries.defaultInstance().createValidator(flavours);
List results = validator.validateAll(parser);
for (ValidationResult result : results) {
if (result.isCompliant()) {
// File complies to flavour
} else {
// File doesn't comply to flavour
}
}
} catch (IOException | ValidationException | ModelParsingException | EncryptedPdfException exception) {
// Exception during validation
}
```
--------------------------------
### Show Processed File Names
Source: https://docs.verapdf.org/cli/validation
Display the names of all processed files during batch operations. This is useful for tracking progress and identifying specific files in large batches.
```bash
verapdf -d ...
```
--------------------------------
### Include Logs in Report
Source: https://docs.verapdf.org/cli/validation
Include log messages directly within the generated report. The level of detail for logs can be controlled using the `--loglevel` option.
```bash
verapdf --addlogs --loglevel 4 ...
```
--------------------------------
### Default validation configuration
Source: https://docs.verapdf.org/cli/config
The standard XML structure for the veraPDF validator configuration file.
```xml
```
--------------------------------
### Add Greenfield Parser Dependency
Source: https://docs.verapdf.org/develop
Include veraPDF's greenfield parser and validation model in your Maven project. Adjust the version as needed.
```xml
org.verapdfvalidation-model1.28.1
```
--------------------------------
### Add PDFBox Parser Dependency
Source: https://docs.verapdf.org/develop
Include the PDFBox-based validation model in your Maven project. Adjust the version as needed.
```xml
org.verapdfpdfbox-validation-model1.28.1
```
--------------------------------
### Metadata Fixer Configuration
Source: https://docs.verapdf.org/cli/config
Configuration for the metadata fixer, specifying a fix ID and a prefix for fixes.
```xml
```