Skip to content

metanorma/mn2pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metanorma mn2pdf

Build Status

Installing Build Tools

You will need the maven build tool and make.

Java Requirements

You will need the Java Development Kit (JDK) version 8, Update 241 (8u241) or higher.

Usage

java -Xss5m -Xmx2048m -jar target/mn2pdf-1.92.jar --xml-file <XML-FileName> --xsl-file <XSLT-FileName> --pdf-file <Output-PDF-FileName> [--syntax-highlight]

e.g.

java -Xss5m -Xmx2048m -jar target/mn2pdf-1.92.jar --xml-file tests/G.191.xml --xsl-file tests/itu.recommendation.xsl --pdf-file tests/G.191.pdf

PDF encryption features

via command-line options

parameter description

--encryption-length <integer>

encryption length in bit

--owner-password <string>

owner password

--user-password <string>

user password

--allow-print <true(default)|false>

'false' for disable printing

--allow-copy-content <true(default)|false>

'false' for disable copy/paste of content

--allow-edit-content <true(default)|false>

'false' for disable editing

--allow-edit-annotations <true(default)|false>

'false' for disable editing of annotations

--allow-fill-in-forms <true(default)|false>

'false' for disable filling in forms

--allow-access-content <true(default)|false>

'false' for disable text and graphics extraction for accessibility purposes

--allow-assemble-document <true|false(default)>

'false' for disable assembling documents

--allow-print-hq <true(default)|false>

'false' for disable high quality printing

--encrypt-metadata <true(default)|false>

'false' for disable encrypt the Metadata stream

via YAML file (--encryption-parameters <filename>)

encryption-length: 128
owner-password: mypass
user-password: userpass
allow-print: false
allow-print-hq: true
allow-copy-content: true
allow-edit-content: false
allow-edit-annotations: true
allow-fill-in-forms: false
allow-access-content: true
allow-assemble-document: false
encrypt-metadata: true

Building the package

mn2pdf depends on another packages which published in GitHub Packages registry. Regarding https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry you need an access token to install these packages. Please set the environment variable GH_TOKEN for building the mn2pdf package.

For Windows OS:

SET GH_TOKEN=<your GitHub token>

For Linux:

GH_TOKEN=<your GitHub token>

To build:

make all

Releasing a new version

Update version in pom.xml, e.g.:

<groupId>org.metanorma.fop</groupId>
<artifactId>mn2pdf</artifactId>
<version>1.92</version>
<name>Metanorma XML to PDF converter</name>

Build the package using instructions above, the package will be created at: target/mn2pdf-{version}.jar

Tag the same version in Git:

git tag v1.92
git push origin v1.92

Then the corresponding GitHub release will be automatically created at: https://github.com/metanorma/mn2pdf/releases

Testing

The testing environment utilizes these tools:

  • make

We use the ITU Recommendation XSLT for testing. It requires the following fonts installed:

  • Times New Roman

  • Arial

Please follow the instructions here to install prerequisites to run the tests: https://github.com/metanorma/mn-native-pdf

Running the tests:

make test

Ribose Inc.