MaxtDesign

Configuration

Settings Location

Go to Settings → PDF Viewer in your WordPress admin. Settings are organized in tabs:

  • General: Preview quality, load behavior, toolbar defaults
  • Server Info: Server capabilities and ImageMagick status
  • Tools: Bulk processing and cache management
  • Preview Quality

    Three presets control the resolution and quality of generated WebP previews:

  • Low: 72 DPI, 70% quality. Smallest file size, suitable for thumbnails.
  • Medium: 150 DPI, 85% quality. Default. Good balance of clarity and size.
  • High: 300 DPI, 95% quality. Sharpest previews, larger files. Use for document-heavy sites.
  • Changes apply to newly uploaded PDFs. Use the Tools tab to regenerate existing previews.

    Default Load Behavior

    Controls when the full PDF.js viewer loads. Can be overridden per embed.

  • Click (default): Preview image shown. Full viewer loads when user clicks "View Document".
  • Visible: Full viewer loads automatically when the embed scrolls into the viewport (IntersectionObserver).
  • Immediate: Full viewer loads on page load. Use sparingly, since it adds JavaScript to initial load.
  • Default Width

    CSS width value for the viewer container. Default: 100%. Can be overridden per embed with the width attribute.

    Toolbar Controls

    Toggle which buttons appear in the viewer toolbar. Each setting can be overridden per embed:

  • Download: Show/hide the download button (default: on)
  • Print: Show/hide the print button (default: on)
  • Fullscreen: Show/hide the fullscreen button (default: on)
  • Preload Viewer

    When enabled, the PDF.js library is preloaded in the background after page load (using ). Reduces the delay when the user clicks to view a PDF. Default: off.

    Cache Duration

    How long generated preview images are cached. Default: 30 days. The cache stores preview metadata to avoid re-processing PDFs that haven't changed.

    Gutenberg Block Settings

    When inserting the PDF Viewer block, each instance has its own settings panel:

  • PDF: Select from Media Library
  • Width: Override default width
  • Load Behavior: Override default (click/visible/immediate)
  • Show Toolbar: Toggle the entire toolbar
  • Show Download: Toggle download button
  • Show Print: Toggle print button
  • Show Fullscreen: Toggle fullscreen button
  • Alignment: Wide and full alignment support
  • Spacing: Margin controls
  • Shortcode Attributes

    [pdf_viewer id="123" width="80%" load="visible" toolbar="true"]

  • id (required): Attachment ID of the PDF
  • width: CSS width value (default: from settings)
  • load: Load behavior: click, visible, immediate (default: from settings)
  • toolbar: Show toolbar: true/false (default: true)