added a stylesheet argument to the makePDF method so that it could
authorjohn <john>
Wed, 25 Sep 2002 21:16:42 +0000 (21:16 +0000)
committerjohn <john>
Wed, 25 Sep 2002 21:16:42 +0000 (21:16 +0000)
be fully ocnfigured from producers.xml

source/mir/misc/PDFUtil.java

index 78a90e6..05534dc 100755 (executable)
@@ -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) {