Title: Saral PDF Preview for WooCommerce
Author: Akaal Creatives
Published: <strong>May 28, 2026</strong>
Last modified: May 28, 2026

---

Search plugins

![](https://ps.w.org/saral-pdf-preview-for-woocommerce/assets/banner-772x250.png?
rev=3551995)

![](https://ps.w.org/saral-pdf-preview-for-woocommerce/assets/icon-256x256.png?rev
=3551995)

# Saral PDF Preview for WooCommerce

 By [Akaal Creatives](https://profiles.wordpress.org/akaalcreatives/)

[Download](https://downloads.wordpress.org/plugin/saral-pdf-preview-for-woocommerce.1.2.0.zip)

 * [Details](https://wordpress.org/plugins/saral-pdf-preview-for-woocommerce/#description)
 * [Reviews](https://wordpress.org/plugins/saral-pdf-preview-for-woocommerce/#reviews)
 *  [Installation](https://wordpress.org/plugins/saral-pdf-preview-for-woocommerce/#installation)
 * [Development](https://wordpress.org/plugins/saral-pdf-preview-for-woocommerce/#developers)

 [Support](https://wordpress.org/support/plugin/saral-pdf-preview-for-woocommerce/)

## Description

Saral PDF Preview lets you attach a PDF file to any WooCommerce product. A configurable
button appears on the product page and opens the PDF in a clean, distraction-free
lightbox — no download, no print, just a smooth in-browser reading experience powered
by PDF.js.

**Features**

 * Upload a PDF per product via a dedicated meta box in the product editor.
 * Configurable button text (default: “Preview Book”).
 * Choose from 7 hook locations on the product page — a live visual diagram shows
   exactly where the button will appear.
 * **Protected mode** (default): the real PDF URL is never exposed to visitors; 
   the file is streamed through a signed REST endpoint.
 * **Public mode**: uses the standard WordPress attachment URL.
 * Zoom in / zoom out controls inside the lightbox.
 * Keyboard accessible — press Escape to close.
 * Responsive layout on mobile.
 * No tracking, no external requests, no upsells.

## Screenshots

[⌊Admin settings page — configure button text, hook position, and file serving mode.⌉⌊
Admin settings page — configure button text, hook position, and file serving mode
.⌉[

Admin settings page — configure button text, hook position, and file serving mode.

[⌊The "Preview Book" button on a WooCommerce product page.⌉⌊The "Preview Book" button
on a WooCommerce product page.⌉[

The “Preview Book” button on a WooCommerce product page.

[⌊The PDF lightbox open on a product page — zoom controls, keyboard accessible, 
no download option.⌉⌊The PDF lightbox open on a product page — zoom controls, keyboard
accessible, no download option.⌉[

The PDF lightbox open on a product page — zoom controls, keyboard accessible, no
download option.

## Installation

 1. Upload the `saral-pdf-preview-for-woocommerce` folder to `/wp-content/plugins/`.
 2. Activate the plugin through the **Plugins** menu in WordPress.
 3. Go to **WooCommerce  PDF Preview** to configure the button text, position, and 
    serving mode.
 4. Edit any product, find the **PDF Preview** meta box, and upload a PDF.

## FAQ

### Does this work with any WooCommerce theme?

Yes. The button is injected via standard WooCommerce action hooks so it works with
any theme that respects the WooCommerce template hierarchy.

### Can customers download the PDF?

No. The lightbox intentionally has no download or print controls. In Protected mode
the real file URL is never sent to the browser, so determined users cannot easily
retrieve it either.

### Is a login required to view the preview?

No. All visitors (logged-in or not) can open the lightbox.

### How large can the PDF be?

There is no hard limit imposed by this plugin. Your server’s `max_execution_time`
and `memory_limit` settings apply as usual. For very large PDFs, consider splitting
them into a shorter sample.

### Which PDF.js version is bundled?

PDF.js 5.7.284.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Saral PDF Preview for WooCommerce” is open source software. The following people
have contributed to this plugin.

Contributors

 *   [ Akaal Creatives ](https://profiles.wordpress.org/akaalcreatives/)

[Translate “Saral PDF Preview for WooCommerce” into your language.](https://translate.wordpress.org/projects/wp-plugins/saral-pdf-preview-for-woocommerce)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/saral-pdf-preview-for-woocommerce/),
check out the [SVN repository](https://plugins.svn.wordpress.org/saral-pdf-preview-for-woocommerce/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/saral-pdf-preview-for-woocommerce/)
by [RSS](https://plugins.trac.wordpress.org/log/saral-pdf-preview-for-woocommerce/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.2.0

 * Upgraded PDF.js from 3.11.174 to 5.7.284.
 * PDF.js now loads lazily on first lightbox open via dynamic import — reduces initial
   page weight.
 * Hardened output escaping: button HTML is now passed through wp_kses() with an
   explicit allowlist; admin meta box attribute conditionals rewritten to eliminate
   unescaped echo calls.

#### 1.1.0

 * Added data-pdf-preview-trigger attribute as the lightbox trigger — any custom
   element can now open the lightbox without relying on the plugin’s CSS class.
 * Added saral_pdf_preview_for_woocommerce_trigger_attr() helper function for use
   in theme templates and custom markup.
 * Added saral_pdf_preview_for_woocommerce_trigger_attr filter to override the trigger
   attribute string.
 * Settings page now documents the custom trigger element feature with usage examples.

#### 1.0.6

 * Added shortcode [saral_pdf_preview_for_woocommerce] — place the preview button
   in any custom location on a product page without touching theme files. Accepts
   an optional id attribute to target a specific product from any page.
 * Added PHP template tag support: echo do_shortcode( ‘[saral_pdf_preview_for_woocommerce]’)
   for use directly in theme templates.
 * Settings page now includes a Manual Embedding section with copy-ready shortcode
   and PHP snippets.

#### 1.0.5

 * Added “Data on Uninstall” setting — choose whether to keep or remove PDF assignments
   from products when the plugin is deleted. Defaults to keeping the data so assignments
   are restored on reinstall.

#### 1.0.4

 * Security: protected endpoint now verifies the product exists and is published
   before streaming the PDF.
 * Security: Content-Disposition filename is now sanitised before being sent in 
   the response header.
 * Fixed: REST endpoint returns a proper error response instead of calling wp_die().
 * Fixed: loading spinner now hides correctly if a network error occurs during PDF
   load.
 * Fixed: uploading a non-PDF attachment no longer leaves stale metadata on the 
   product.
 * Fixed: preview button is now guarded against malformed button hook settings.
 * Fixed: PDF attachment MIME type is verified in public serving mode before use.
 * Improved: admin media frame strings (Select PDF, Use this PDF) are now translatable.
 * Improved: modal dialog now uses aria-labelledby for better screen reader support.

#### 1.0.3

 * Added loading spinner shown while PDF is downloading and rendering.

#### 1.0.2

 * Bumped asset version to bust browser cache after identifier rename.

#### 1.0.1

 * Renamed all internal identifiers to match plugin slug.
 * Fixed 403 on protected PDF endpoint for logged-in users.

#### 1.0.0

 * Initial release.

## Meta

 *  Version **1.2.0**
 *  Last updated **2 months ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.5 or higher **
 *  Tested up to **6.9.5**
 *  PHP version ** 8.1 or higher **
 * Tags
 * [lightbox](https://wordpress.org/plugins/tags/lightbox/)[pdf](https://wordpress.org/plugins/tags/pdf/)
   [preview](https://wordpress.org/plugins/tags/preview/)[product](https://wordpress.org/plugins/tags/product/)
   [woocommerce](https://wordpress.org/plugins/tags/woocommerce/)
 *  [Advanced View](https://wordpress.org/plugins/saral-pdf-preview-for-woocommerce/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/saral-pdf-preview-for-woocommerce/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/saral-pdf-preview-for-woocommerce/reviews/)

## Contributors

 *   [ Akaal Creatives ](https://profiles.wordpress.org/akaalcreatives/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/saral-pdf-preview-for-woocommerce/)