XWiki Platform
  1. XWiki Platform
  2. XWIKI-5918

Impossible to override XSLT documents used in the PDF export process

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0 M1
    • Fix Version/s: 3.0 M2
    • Component/s: {Unused} Export
    • Labels:
      None
    • Difficulty:
      Unknown
    • Similar issues:
      XWIKI-7490Image size do not display correctly in the PDF export
      XWIKI-223PDF export fails with unescaped angle brackets
      XWIKI-7868PDF Export of document created with app within minutes only displays values of fields (no labels)
      XWIKI-3318Broken quotes in PDF/RTF exports of html:q elements
      XWIKI-10001Add a new option "title" during a PDF export
      XWIKI-2556Scaled images in exported PDF and RTF have wrong dimensions
      XWIKI-2376Exporting to PDF does not work correctly with #includeForm
      XWIKI-1846PDF Export Looping
      XWIKI-1052PDF forms export
      XWIKI-3324PDF Export of Main.Spaces throws exception

      Description

      The documentation at http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Configuration#HCustomizingthePDFexportLook26Feel doesn't actually work when it comes to overriding the xhtml2fo.xsl and fop.xsl stylesheets.

      Although the implementation suggests that the xhtmlxsl and fopxsl properties of the XWiki.PDFClass class is supposed to contain the actual content of the xslt file, it is actually used as the name of a filesystem resource.

        Activity

        Hide
        Sergiu Dumitriu added a comment -

        Fixed in r34252.

        Show
        Sergiu Dumitriu added a comment - Fixed in r34252.
        Hide
        Anca Luca added a comment -

        Actually this issue introduces a problem, the fact that, not even the standard xhtml2fo.xsl file fits in the property without modifications (minification), let alone customized one, since the limit for texarea properties in the mapping is set to 60 000 characters, so this 'fix' is slightly useless as is.

        Lucky enough, a detail which is not mentioned in the documentation, is that you can have velocity in this field, which allows you to put the desired xsl in an attachment somewhere (skin or pdftemplate sounds like good places to put it), and get its content with velocity, something like:

        $xwiki.getDocument('MyApp.PDFTemplate').getAttachment('xhtml2fo-myapp.xsl').contentAsString
        
        Show
        Anca Luca added a comment - Actually this issue introduces a problem, the fact that, not even the standard xhtml2fo.xsl file fits in the property without modifications (minification), let alone customized one, since the limit for texarea properties in the mapping is set to 60 000 characters, so this 'fix' is slightly useless as is. Lucky enough, a detail which is not mentioned in the documentation, is that you can have velocity in this field, which allows you to put the desired xsl in an attachment somewhere (skin or pdftemplate sounds like good places to put it), and get its content with velocity, something like: $xwiki.getDocument('MyApp.PDFTemplate').getAttachment('xhtml2fo-myapp.xsl').contentAsString

          People

          • Assignee:
            Sergiu Dumitriu
            Reporter:
            Sergiu Dumitriu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Date of First Response: