Skip to content

Commit

Permalink
added baseassetpath processing, metanorma/metanorma-cli#255
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelligent2013 committed Oct 9, 2021
1 parent 9787078 commit 7568b96
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SHELL ?= /bin/bash
endif

#JAR_VERSION := $(shell mvn -q -Dexec.executable="echo" -Dexec.args='$${project.version}' --non-recursive exec:exec -DforceStdout)
JAR_VERSION := 1.37
JAR_VERSION := 1.38
JAR_FILE := mn2pdf-$(JAR_VERSION).jar

all: target/$(JAR_FILE)
Expand Down
10 changes: 5 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ You will need the Java Development Kit (JDK) version 8, Update 241 (8u241) or hi

[source,sh]
----
java -Xss5m -Xmx2048m -jar target/mn2pdf-1.37.jar --xml-file <XML-FileName> --xsl-file <XSLT-FileName> --pdf-file <Output-PDF-FileName>
java -Xss5m -Xmx2048m -jar target/mn2pdf-1.38.jar --xml-file <XML-FileName> --xsl-file <XSLT-FileName> --pdf-file <Output-PDF-FileName>
----

e.g.

[source,sh]
----
java -Xss5m -Xmx2048m -jar target/mn2pdf-1.37.jar --xml-file tests/G.191.xml --xsl-file tests/itu.recommendation.xsl --pdf-file tests/G.191.pdf
java -Xss5m -Xmx2048m -jar target/mn2pdf-1.38.jar --xml-file tests/G.191.xml --xsl-file tests/itu.recommendation.xsl --pdf-file tests/G.191.pdf
----


Expand Down Expand Up @@ -61,7 +61,7 @@ Update version in `pom.xml`, e.g.:
----
<groupId>org.metanorma.fop</groupId>
<artifactId>mn2pdf</artifactId>
<version>1.37</version>
<version>1.38</version>
<name>Metanorma XML to PDF converter</name>
----

Expand All @@ -72,8 +72,8 @@ Tag the same version in Git:

[source,xml]
----
git tag v1.37
git push origin v1.37
git tag v1.38
git push origin v1.38
----

Then the corresponding GitHub release will be automatically created at:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.metanorma.fop</groupId>
<artifactId>mn2pdf</artifactId>
<version>1.37</version>
<version>1.38</version>
<name>Metanorma XML to PDF converter</name>
<packaging>jar</packaging>
<url>https://www.metanorma.org</url>
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/org/metanorma/fop/PDFGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,12 @@ private void convertmn2pdf(fontConfig fontcfg, SourceXMLDocument sourceXMLDocume
// index.xml was created for bilingual document
additionalXSLTparams.setProperty("external_index", fileXmlIF.getAbsolutePath());
}
additionalXSLTparams.setProperty("basepath", sourceXMLDocument.getDocumentFilePath() + File.separator);
String basepath = sourceXMLDocument.getDocumentFilePath() + File.separator;
// redefine basepath
if (xsltParams.containsKey("baseassetpath")) {
basepath = xsltParams.getProperty("baseassetpath") + File.separator;
}
additionalXSLTparams.setProperty("basepath", basepath);
xsltConverter.setParams(additionalXSLTparams);

//System.out.println("[INFO] XSL-FO file preparation...");
Expand Down

0 comments on commit 7568b96

Please sign in to comment.