提交 94ef3b4e authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Try old way of PDF generation first

上级 7cdecfd5
...@@ -369,23 +369,20 @@ public class Build extends BuildBase { ...@@ -369,23 +369,20 @@ public class Build extends BuildBase {
delete(files("bin").keep("*.jar")); delete(files("bin").keep("*.jar"));
jar(); jar();
docs(); docs();
boolean pdfReady = false;
try { try {
if (exec("soffice", args("--convert-to", "pdf", "--outdir", "docs/html", "docs/html/onePage.html")) == 0) { exec("soffice", args("-invisible", "macro:///Standard.Module1.H2Pdf"));
File f = new File("docs/html/onePage.pdf"); copy("docs", files("../h2web/h2.pdf"), "../h2web");
if (f.exists() && f.renameTo(new File("docs/h2.pdf"))) { } catch (Exception e) {
pdfReady = true; print("OpenOffice is not available: " + e);
}
}
} catch (Exception ex) {
}
if (!pdfReady) {
// Old way
try { try {
exec("soffice", args("-invisible", "macro:///Standard.Module1.H2Pdf")); if (exec("soffice", args("--convert-to", "pdf", "--outdir", "docs/html",
copy("docs", files("../h2web/h2.pdf"), "../h2web"); "docs/html/onePage.html")) == 0) {
} catch (Exception e) { File f = new File("docs/html/onePage.pdf");
print("OpenOffice is not available: " + e); if (f.exists()) {
f.renameTo(new File("docs/h2.pdf"));
}
}
} catch (Exception ex) {
} }
} }
delete("docs/html/onePage.html"); delete("docs/html/onePage.html");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论