Legacy Knowledge Base
Published Jul. 2, 2025

How to resolve Document Library PDF previews taking up more disk space than the original files

Written By

Isaac Wilson

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • While examining our document library in a file system, we saw that the storage being used for preview files are taking up three times the amount of disk space as the storage for the original files uploaded to documents and media, leading to disk space usage issues. In particular, PDF files seem to be the largest contributor, with their previews much larger than their original files.

Environment

  • DXP 7.0
  • DXP 7.1
  • DXP 7.2

Resolution

  • This behavior is expected, as .png files (used for previews) use a lossless compression algorithm, while PDFs can contain images using a lossy compression algorithm. As such, a .png file of the same image can take up more space depending on how many colors are included within the image.
  • Document previews can be adjusted to fit one's use case using the following portal properties (defaults for 7.2 provided below):
        dl.file.entry.preview.enabled=true
    ...
        dl.file.entry.preview.document.depth=8
        dl.file.entry.preview.document.dpi=300
        dl.file.entry.preview.document.max.height=0
        dl.file.entry.preview.document.max.width=1000
        dl.file.entry.preview.video.height=360
        dl.file.entry.preview.video.width=640
    • Setting dl.file.entry.preview.enabled=false will disable previews entirely
    • Lowering the *.height and *.width will make the previews smaller (saving disk space)
    • Lowering *.dpi will decrease the image resolution while retaining the original size

Additional Information

 

Did this article resolve your issue ?

Legacy Knowledge Base