From: john Date: Wed, 25 Sep 2002 21:16:42 +0000 (+0000) Subject: added a stylesheet argument to the makePDF method so that it could X-Git-Tag: BEFORE_MERGE_1_1~538 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=424d1b80a1e0b09dc5c95aa5c3ae0a5101a6dcfe;p=mir.git added a stylesheet argument to the makePDF method so that it could be fully ocnfigured from producers.xml --- diff --git a/source/mir/misc/PDFUtil.java b/source/mir/misc/PDFUtil.java index 78a90e6a..05534dca 100755 --- a/source/mir/misc/PDFUtil.java +++ b/source/mir/misc/PDFUtil.java @@ -43,7 +43,7 @@ import org.apache.log.*; public class PDFUtil { - public static void makePDF(String foFilePath,Object pdfDestination) throws Exception + public static void makePDF(String foFilePath,Object pdfDestination,String stylesheetPath) throws Exception { try{ Driver driver = new Driver(); @@ -59,13 +59,19 @@ public class PDFUtil { File foFile=new File(foFilePath); - String html2foStyleSheetPath=MirGlobal.getConfigProperty("Home") + String html2foStyleSheetPath; + if (stylesheetPath == "FROMCONFIG"){ + html2foStyleSheetPath=MirGlobal.getConfigProperty("Home") + MirGlobal.getConfigProperty("HTMLTemplateProcessor.Dir") + "/" + MirGlobal.getConfigProperty("Producer.PrintableContent.html2foStyleSheetName"); + } + else { + html2foStyleSheetPath=stylesheetPath; + } File html2foStyleSheet=new File(html2foStyleSheetPath); InputHandler inputHandler = - new XSLTInputHandler(foFile, html2foStyleSheet); + new XSLTInputHandler(foFile, html2foStyleSheet); XMLReader parser = inputHandler.getParser(); if (pdfDestination instanceof String) {