Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-97713

JPEG-format image of PDF data viewed through a PDF macro on a Confluence Data Center page is noticeably blurry

XMLWordPrintable

      Issue Summary

      Since Confluence 7.19.20, the JPEG-format image of PDF data seen through the use of a PDF macro on a Confluence DC page is noticeably blurry compared to a crisp/clear render from prior versions.
      note: Confluence 7.19.20 bundles Office Connector plugin version 17.19.15 (OfficeConnector-17.19.15.jar).

      This is reproducible on Data Center: Yes.

      Steps to Reproduce

      1. attach/drag-drop a PDF file on a Confluence Data Center page
      2. then:
        • edit the page,
        • add the PDF macro on that page
        • in the macro's File Name * drop-down, choose the PDF attached to the page, and
        • click Insert
      3. publish the page

      Expected Results

      The PDF macro viewer will show a readable/clear JPEG-format version of the PDF data through the following endpoint:

      <BaseURLWithContextIfAny>/plugins/servlet/pptslide?attachment=PDFFileName.pdf&attachmentId=<numericAttachmentID>&attachmentVer=<numericAttachmentVersion>&pageId=<numbericPageID>&slide=<numbericSlideNumber>

      (eg. http://localhost:8090/confluence/plugins/servlet/pptslide?attachment=simple_macros.pdf&attachmentId=23330833&attachmentVer=1&pageId=23330832&slide=0)

      The JPEG-format data that is being previewed is itself created at the instance's <sharedHome>/viewfile/temp/ directory (file(s) with a random uuid-style name(s), without any file-extension).

      Actual Results

      The JPEG-format data is blurred to a suboptimal resolution that makes it nearly unreadable (especially where fonts with narrow spacing (such as Asian-language fonts) are used).

      The actual resolution value (pixel height, width) can be seen in the request's browser-diagnostics data, under Network > (click on the corresponding PDF macro data endpoint/URL similar to the one mentioned above) > Preview tab (sample screenshot attached).

      This resolution will be nearly half (pixel height, width) of the resolution of JPEG previews from previous Confluence versions.


      Workaround

      Memory intensive tasks related to document-conversion are expected to be executed by Confluence's External Process Pool (separate sandbox JVMs that can crash or be terminated, and will be restarted automatically by Confluence, without affecting the Confluence application itself).
      This functionality was enhanced to include some edge cases (like the usage of PDF macro in this case).
      It is during this modified flow, that the low-resolution JPEG-format data is created at the instance's <sharedHome>/viewfile/temp/ directory (file(s) with a random uuid-style name(s), without any file-extension).

      To revert the instance's functionality to produce higher resolution JPEG images with better readability:

      • submit officeconnector.slide.sandbox.bypass in the Enable dark feature field at the instance's Development Features Screen
        caution: this will bypass Confluence's External Process Pool and assign the conversion of PDF to JPEG data to the Confluence JVM/process, which (under rare circumstances and sufficient memory pressure) will expose the Confluence JVM/process to the risk of crashes from memory overflow/exhaustion.
      • reattempt conversion (either by attaching the PDF on a new page and using a PDF macro on that page, or after clearing the already generated preview from <sharedHome>/viewfile/temp/ and then reloading the existing page)

              20f00d30f8b9 Franco Skrzypczak (Inactive)
              5c3a8aca27ce Mohit Sharma
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: