CycloneDX (VEX) to PDF Converter
A command-line tool to convert CycloneDX VEX (Vulnerability Exploitability eXchange) documents in JSON or XML format to PDF reports.
- CycloneDX (VEX) to PDF Converter
⚠️ Font Requirement
This application requires Liberation Sans fonts to properly render PDF documents.
The Liberation Sans fonts are NOT included in this repository due to licensing considerations. To set up the required fonts:
- Download the Liberation Sans TTF fonts from the official repository
- Create a directory in the project root:
fonts/liberation-fonts - Place the following TTF files in that directory:
- LiberationSans-Regular.ttf
- LiberationSans-Bold.ttf
- LiberationSans-Italic.ttf
- LiberationSans-BoldItalic.ttf
Alternative options:
- On Linux systems, if the fonts are installed system-wide (typically in
/usr/share/fonts/liberation-sans), the application will attempt to use them. - Set the font path through the
VEX2PDF_FONTS_PATHenvironment variable.
Note: The Liberation Fonts are licensed under the SIL Open Font License, not MIT. Please respect their license terms when using them.
Overview
VEX2PDF is a Rust application that scans the current directory for CycloneDX VEX files (JSON and XML) and converts them to human-readable PDF reports. It fully supports the CycloneDX VEX schema version 1.5 and provides compatibility for version 1.6 documents that only use 1.5 fields. Documents using 1.6-specific fields may not process correctly. The tool handles various elements of the VEX documentation format including vulnerabilities, components, metadata, and more.
Features
- Automatically scans directories for JSON and XML files with VEX data
- Converts VEX documents to structured PDF reports
- Supports both JSON and XML CycloneDX formats
- Preserves all key VEX information including:
- Document metadata and timestamps
- Vulnerability details with severity ratings
- Component information
- Tools used to generate the VEX document
- Cross-platform support (Linux, Windows)
Installation
Prerequisites
- Rust and Cargo (latest stable version)
- Liberation Sans fonts (must be obtained separately as described in the Font Requirement section)
Via Cargo
The easiest way to install VEX2PDF is directly from crates.io:
After installation, the vex2pdf binary will be available in your Cargo bin directory.
⚠️ Important: You'll still need to set up the Liberation Sans fonts as described in the Font Requirement section. When installing via Cargo, fonts should be placed in one of the paths listed in the Font Path Configuration section.
From Source
Clone the repository, then build the application with cargo build --release. The binary will be available at target/release/vex2pdf.
Windows Users
Windows users can either:
- Install via Cargo as described above
- Build using Rust for Windows from source
- Use a pre-built binary (GitHub Releases Section)
Usage
⚠️ Liberation fonts are needed (Check the Font Path Configuration section above for more details)
Run the application in a directory containing CycloneDX VEX files (JSON or XML):
./vex2pdf
The tool will:
- Scan the current directory for JSON and XML files
- Attempt to parse each file as a CycloneDX VEX document
- Generate a PDF report with the same name as the original file (with .pdf extension)
- Display progress and results in the console
Example
$ ./vex2pdf
vex2pdf v0.6.0 - CycloneDX (VEX) to PDF Converter
Copyright (c) 2025 jurassicLizard - MIT License
Active font path: /usr/share/fonts/liberation-fonts
Scanning for JSON files in: ./documents
Found 2 JSON files
Processing: ./documents/example1.json
Generating PDF: ./documents/example1.pdf
Successfully generated PDF: ./documents/example1.pdf
Processing: ./documents/example2.json
Generating PDF: ./documents/example2.pdf
Successfully generated PDF: ./documents/example2.pdf
Scanning for XML files in: ./documents
Found 5 XML files
Processing: ./documents/example1.xml
Generating PDF: ./documents/example1.pdf
Successfully generated PDF: ./documents/example1.pdf
Processing: ./documents/example2.xml
Generating PDF: ./documents/example2.pdf
Successfully generated PDF: ./documents/example2.pdf
Processing: ./documents/example3.xml
NOTE: Downgrading CycloneDX BOM from spec version 1.6 to 1.5
Reason: Current implementation does not yet support spec version 1.6
Warning: This compatibility mode only works for BOMs that don't utilize 1.6-specific fields
Processing will fail if 1.6-specific fields are encountered
Generating PDF: ./documents/example3.pdf
Successfully generated PDF: ./documents/example3.pdf
Configuration
No configuration files are required. However the application has some customization options available
Font Path Configuration
The application uses these locations for fonts in order of precedence:
- Custom directory specified via
VEX2PDF_FONTS_PATHenvironment variable (if set) - Project-local directory
./fonts/liberation-fonts(if it exists) - User's local fonts directory
~/.local/share/fonts/liberation-fonts(if it exists) - System-wide directory
/usr/share/fonts/liberation-fonts
You can customize the font path by setting the VEX2PDF_FONTS_PATH environment variable:
The specified directory should contain the Liberation Sans font files directly (not in a subdirectory).
For example, if your fonts are in /path/to/your/liberation-fonts/, set:
Linux
Windows (PowerShell)
$env:VEX2PDF_FONTS_PATH="C:\path\to\your\liberation-fonts"
The specified directory should contain these font files:
- LiberationSans-Regular.ttf
- LiberationSans-Bold.ttf
- LiberationSans-Italic.ttf
- LiberationSans-BoldItalic.ttf
Environment Variables
The following environment variables can be used to customize behavior:
| Variable | Purpose | Default |
|---|---|---|
| VEX2PDF_FONTS_PATH | Custom path to look for font files | Check Font Path Configuration |
| VEX2PDF_NOVULNS_MSG | Controls the "No Vulnerabilities reported" message display | true |
VEX2PDF_NOVULNS_MSG
This variable controls how the Vulnerabilities section appears when no vulnerabilities exist:
- When set to "true" or not set (default): A "Vulnerabilities" section will be shown with a "No Vulnerabilities reported" message
- When set to "false": The Vulnerabilities section will be completely omitted from the PDF
Example:
# To hide the Vulnerabilities section when no vulnerabilities exist this is mostly useful when a report for a bom is generated
VEX2PDF_NOVULNS_MSG=false
Documentation
For full API documentation, please visit:
Note: Rust documentation is a work in progress. Please refer to the code comments for details on specific functions and data structures.
To generate documentation locally:
CycloneDX VEX Format
This tool fully supports CycloneDX VEX schema version 1.5 and provides compatibility for version 1.6 documents that only use 1.5 fields. Documents using 1.6-specific fields may not process correctly. For more information about the CycloneDX VEX format, see:
Version 1.6 Compatibility Mode
This tool implements a special compatibility mode for CycloneDX 1.6 documents:
- When the tool encounters a document with
specVersion: "1.6", it will:- Display a notification about downgrading to 1.5
- Automatically modify the document's spec version to "1.5"
- Attempt to process it using the 1.5 schema parser
This compatibility approach works well for documents that don't use 1.6-specific fields but allows the tool to process newer documents without requiring users to manually modify them.
Limitations:
- Documents that use 1.6-specific fields or structures may fail during processing
- No validation is performed for 1.6-specific features
- This is a temporary solution until full 1.6 support is implemented in the underlying cyclonedx-bom library
When processing 1.6 documents, you'll see console messages indicating the compatibility mode is active.
Security Considerations
- The application reads and processes files from the current directory
- No network connections are established
- Input validation is performed on all JSON files
- Font paths are validated before use
License
This project is licensed under the MIT License - see the LICENSE.md file for details. The Liberation Fonts used by this application are licensed under the SIL Open Font License and must be obtained separately.
Acknowledgments
- CycloneDX for the VEX specification
- cyclonedx-bom for CycloneDX parsing
- genpdf for PDF generation
- serde_json for JSON processing
- Liberation Fonts for the PDF rendering fonts