WebBox Klassenbibliothek
ulrich
2020-07-23 f2a70357272c7a2e61f724385e23b4c4fa2e69cb
In Arbeit: PDF Theme
1 files modified
6 ■■■■ changed files
src/de/uhilger/wbx/web/AdocServlet.java 6 ●●●● patch | view | raw | blame | history
src/de/uhilger/wbx/web/AdocServlet.java
@@ -94,6 +94,7 @@
      File pdffile = new File(adocfile.getParentFile(), fname + DOT + PDF);
      outfile = pdffile; // PDF soll zurueckgegeben werden
      if(!pdffile.exists() || adocfile.lastModified() > pdffile.lastModified()) {
        response.setContentType("application/pdf");
        transform(absname, PDF);
      }
    }
@@ -127,11 +128,14 @@
  private void transform(String fileName, String backend) {    
    Map<String, Object> attributes;
    File outFile = new File(fileName);
    String thisDirName = outFile.getParent();
    File pdfStyles = new File(outFile.getParentFile(), "custom-theme.yml");
    if(pdfStyles.exists()) {
      attributes = attributes()
              .attribute("pdf-themesdir", outFile.getParent())
              .attribute("pdf-themesdir", thisDirName)
              .attribute("pdf-theme","custom")
              .attribute("pdf-fontsdir", thisDirName + "/fonts")
              .attribute("allow-uri-read")
              .sourceHighlighter("highlightjs")
              .asMap();
    } else {