From 424d1b80a1e0b09dc5c95aa5c3ae0a5101a6dcfe Mon Sep 17 00:00:00 2001 From: john Date: Wed, 25 Sep 2002 21:16:42 +0000 Subject: [PATCH] added a stylesheet argument to the makePDF method so that it could be fully ocnfigured from producers.xml --- source/mir/misc/PDFUtil.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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) { -- 2.11.0