From da6cfb12c67b12c9e7a3b7abd8687ad7453308bc Mon Sep 17 00:00:00 2001
From: ulrich@undisclosed <ulrich@ulrich-vaio>
Date: Thu, 28 May 2020 08:05:53 +0000
Subject: [PATCH] Fehler bei PDF-Umwandlung behoben

---
 src/de/uhilger/wbx/web/AdocServlet.java |   30 ++++++++++++++----------------
 1 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/src/de/uhilger/wbx/web/AdocServlet.java b/src/de/uhilger/wbx/web/AdocServlet.java
index af4736b..61ec3cc 100644
--- a/src/de/uhilger/wbx/web/AdocServlet.java
+++ b/src/de/uhilger/wbx/web/AdocServlet.java
@@ -126,24 +126,22 @@
    * nach PDF transformiert werden soll
    */
   private void transform(String fileName, String backend) {    
-    /*
-    Map<String, Object> attributes = new HashMap<>();
-    attributes.put("no_footer", false);
-    //attributes.put("source_highlighter", "highlightjs");
-
-    Map<String, Object> options = new HashMap<>();
-    options.put("attributes", attributes); 
-    options.put("in_place", false); 
+    Map<String, Object> attributes = attributes()
+                                      .sourceHighlighter("highlightjs")
+                                      .asMap();
+    Map<String, Object> options;
     if(null != backend) {
-      options.put("backend", backend);
+      options = options()
+                  .inPlace(false)
+                  .backend(backend)
+                  .attributes(attributes)
+                  .asMap();
+    } else {
+      options = options()
+                  .inPlace(false)
+                  .attributes(attributes)
+                  .asMap();
     }
-    */
-    
-    Map<String, Object> attributes = attributes().sourceHighlighter("highlightjs")
-                                       .asMap();
-    Map<String, Object> options = options().inPlace(false).attributes(attributes)
-                                       .asMap();
-
     
     Asciidoctor asciidoctor = create();    
     asciidoctor.convertFile(new File(fileName), options);    

--
Gitblit v1.9.3