Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-16844

PDF export is polluted with "default CSS" whenever a custom CSS is applied

    XMLWordPrintable

Details

    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce:

      • add a custom style to the pdf export, using pdf.css attached to skin or a pdftemplate containing some CSS in the style property
      • add just one rule of style in that pdf - coloring a span or the headings

      Expected results:

      • the difference in inline CSS between the export with style and the export with no style at all is only for the elements that are targeted by the applied style (span or headings)

      Actual results:

      • a bunch of "default CSS" is applied, lots of elements from the html receive some default styling, including display type, margins, etc.

      Actually, this extra styling can be easily seen in this test https://github.com/xwiki/xwiki-platform/blob/xwiki-platform-10.11.9/xwiki-platform-core/xwiki-platform-oldcore/src/test/java/com/xpn/xwiki/pdf/impl/PdfExportImplTest.java#L76 , where the expected value actually contains this extra style.

      As some visual consequence of the extra style, noticed on a 10.11.9 - these were observed quickly, may be others:

      • there are some margins to the text (paragraphs), that make the text lines a little shorter (not aligned with the hr of the title anymore),
      • some extra space above the text,
      • extra indentation for a list

      See for visual highlights.

      Attachments

        Activity

          People

            vmassol Vincent Massol
            lucaa Anca Luca
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: