Documentation

Getting Started Guide

Everything you need to know to start sharing your PDFs professionally. Complete documentation for WordPress, Drupal and React / Next.js.

Getting Started

Install and configure the plugin in minutes

1

Install the Plugin

Via WordPress Admin:

  1. Go to Plugins > Add New
  2. Search for "PDF Embed SEO Optimize"
  3. Click Install, then Activate

Or via WP-CLI:

wp plugin install pdf-embed-seo-optimize --activate
2

Upload Your First PDF

  1. Go to PDF Documents > Add New
  2. Enter a title for your PDF
  3. Click "Upload PDF" and select your file
  4. Add a description (optional but recommended for SEO)
  5. Click "Publish" to make it live
3

Configure Display Options

  1. Choose viewer type: In-Page or Standalone
  2. Toggle Download and Print permissions
  3. Set viewer height (default: 800px)
  4. Add password protection (Pro feature)
4

View Your PDF

  1. Click "View PDF" to see the SEO-optimized page
  2. Check /pdf/ to see all your documents
  3. Share the URL - it's search engine ready!

Configuration

Navigate to: PDF Documents > Settings

Setting Default
Allow Download by Default Yes
Allow Print by Default Yes
Auto-generate Thumbnails Yes
Viewer Theme Light
Viewer Height 800px
Archive Posts per Page 12

Automatic Google Sitemap

Help search engines find all your PDF documents automatically

Your PDF sitemap is available at:

yourdomain.com/pdf/sitemap.xml

The plugin automatically creates a special sitemap just for your PDFs. This helps Google and other search engines discover and index all your documents, making them easier for customers to find.

Good to know: You can submit this sitemap to Google Search Console to help your documents appear in search results faster.

Shortcodes & Blocks

Embed PDFs anywhere on your site

Quick Embed Steps

1

Get PDF ID

Find it in PDF Documents list

2

Add Shortcode

Use [pdf_viewer id="X"]

3

Customize Size

Add width/height attributes

4

Publish

Save and preview your page

[pdf_viewer]

Embed a single PDF viewer.

Attribute Default Description
id Current post PDF document ID
width 100% Viewer width
height 800px Viewer height
[pdf_viewer id="123" width="100%" height="600px"]

[pdf_viewer_sitemap]

Display a list of all PDFs.

Attribute Default Description
orderby title Sort: title, date, menu_order
order ASC Direction: ASC, DESC
limit -1 Number of PDFs (-1 for all)
[pdf_viewer_sitemap orderby="date" order="DESC" limit="10"]

Gutenberg Block

  1. In the block editor, click "+" to add a block
  2. Search for "PDF Viewer"
  3. Select the PDF document from the dropdown
  4. Adjust width/height in block settings

PDF AcroForms (Fillable Forms)

Interactive form fields in your PDF viewer

What are AcroForms?

AcroForms are interactive form fields embedded in PDF documents. When a PDF contains fillable fields (text inputs, checkboxes, radio buttons, dropdowns), the viewer automatically detects them and displays an interactive form toolbar.

This feature works with any PDF that contains standard AcroForm fields — no additional configuration is required. Simply upload your fillable PDF and the form toolbar appears automatically.

How It Works

1

Upload PDF

Upload a PDF with AcroForm fields

2

Auto-Detection

Viewer detects form fields automatically

3

Fill Fields

Users fill in text, checkboxes, and dropdowns

4

Download / Print

Download or print the filled PDF

Form Toolbar

When a PDF with form fields is loaded, a blue toolbar appears below the main viewer toolbar with these controls:

Button Description
Form Fields Detected Label indicating the PDF contains fillable form fields. Toolbar only appears when form fields are found.
Clear Form Resets all form fields to their default empty state. Useful when users want to start over.
Download Filled PDF Downloads the PDF with all filled-in form data embedded. Only shown when downloads are enabled for the document.

Supported Field Types

Text Fields

Single-line and multi-line text inputs for names, addresses, comments, etc.

Checkboxes

Toggle checkboxes for yes/no options, agreements, and multi-select choices.

Radio Buttons

Single-select option groups where only one choice can be selected.

Dropdown Menus

Select menus with predefined options for structured data entry.

WordPress

AcroForms work automatically with any PDF uploaded via the PDF Documents admin. No shortcode changes needed — forms are detected on page load.

Drupal

Upload a fillable PDF via the PDF Document entity form. The viewer template includes the annotation layer and form toolbar out of the box.

React / Next.js

The PdfViewer component handles AcroForms automatically. Form fields render as interactive overlays when detected in the loaded PDF.

REST API Reference

Base URL: /wp-json/pdf-embed-seo/v1/

GET /documents

List all published PDF documents.

Parameter Type Description
page int Page number (default: 1)
per_page int Items per page (max 100)
search string Search term
orderby string date, title, modified, views

GET /documents/{id}

Get single PDF document details.

Returns: id, title, slug, url, description, thumbnail, file_size, page_count, view_count, dates

GET /documents/{id}/data

Get secure PDF URL for viewer (AJAX-based).

Returns: success, url (temporary secure URL), expires

POST /documents/{id}/view

Track a PDF view (increment view counter).

GET /settings

Get public plugin settings (viewer theme, height, permissions).

Premium Endpoints

Pro
  • GET /analytics Dashboard summary (total views, unique visitors, popular docs)
  • GET /analytics/documents Per-document analytics
  • GET /analytics/export Export data (CSV/JSON)
  • GET /documents/{id}/progress Get reading progress
  • POST /documents/{id}/progress Save reading progress (page, scroll, zoom)
  • POST /documents/{id}/verify-password Verify password for protected PDFs
  • POST /documents/{id}/download Track PDF download
  • POST /documents/{id}/expiring-link Generate expiring access link

Example Response

{ "id": 123, "title": "Annual Report 2024", "slug": "annual-report-2024", "url": "https://example.com/pdf/annual-report-2024/", "excerpt": "Company annual report...", "date": "2024-01-15T10:30:00+00:00", "views": 1542, "thumbnail": "https://example.com/wp-content/uploads/thumb.jpg"
}

WordPress Hooks

Extend and customize the plugin functionality

Actions

  • pdf_embed_seo_pdf_viewed Fired when PDF is viewed ($post_id, $count)
  • pdf_embed_seo_premium_init Premium features initialized
  • pdf_embed_seo_settings_saved Settings saved

Filters

  • pdf_embed_seo_schema_data Modify Schema.org data for a single PDF
  • pdf_embed_seo_archive_schema_data Modify Schema.org data for archive page
  • pdf_embed_seo_archive_query Modify archive page posts per page
  • pdf_embed_seo_sitemap_query_args Modify sitemap shortcode query args
  • pdf_embed_seo_archive_title Modify the archive page title
  • pdf_embed_seo_archive_description Modify the archive page description
  • pdf_embed_seo_viewer_options Modify PDF.js viewer options
  • pdf_embed_seo_allowed_types Modify allowed MIME types for upload
  • pdf_embed_seo_rest_document Modify REST API document response
  • pdf_embed_seo_rest_document_data Modify REST API document data
  • pdf_embed_seo_rest_settings Modify REST API settings response

Example: Add custom schema data

add_filter( 'pdf_embed_seo_schema_data', function( $schema, $post_id ) { $schema['author'] = [ '@type' => 'Person', 'name' => get_post_meta( $post_id, '_pdf_author', true ), ]; return $schema;
}, 10, 2 );

Theming & Templates

Customize the look and feel

1

Copy Template Files

  1. Navigate to wp-content/plugins/pdf-embed-seo-optimize/templates/
  2. Copy the template file you want to customize
  3. Paste it into your theme folder (e.g., wp-content/themes/your-theme/)
2

Available Template Files

  • single-pdf_document.php Controls single PDF page layout, viewer placement, and metadata display
  • archive-pdf_document.php Controls PDF archive/listing page with grid or list view
  • content-pdf_document.php Individual PDF card in archive listings
3

Customize with CSS

Add custom styles to your theme's style.css:

/* Custom PDF viewer styling */
.pdf-viewer-container { border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
/* PDF archive grid */
.pdf-archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem;
}
4

Use Template Tags

Available template tags for your custom templates:

  • pdf_embed_seo_get_viewer() - Output the PDF viewer
  • pdf_embed_seo_get_thumbnail() - Get PDF thumbnail URL
  • pdf_embed_seo_get_download_url() - Get secure download URL
  • pdf_embed_seo_get_page_count() - Get PDF page count
  • pdf_embed_seo_get_view_count() - Get view count

Developer Documentation

For Developers

Extend and integrate PDF Embed with hooks, REST API, and webhooks

Premium Feature Classes

Feature Class
Analytics Dashboard Premium_Analytics
Password Protection Premium_Password
Detailed View Tracking Premium_Tracking
Reading Progress Premium_Progress
XML Sitemap Premium_Sitemap
PDF Categories & Tags Premium_Taxonomies
CSV/JSON Export Premium_Export
Role-Based Access Premium_Roles
Bulk Import Premium_Bulk
Full REST API Premium_API
White-Label Options Premium_WhiteLabel

WordPress Hooks (Extended)

pdf_embed_seo_pdf_viewed action

Fires after a PDF is viewed with post ID and view count

add_action( 'pdf_embed_seo_pdf_viewed', function( $post_id, $count ) { // Your code here
}, 10, 2 );
pdf_embed_seo_schema_data filter

Modify Schema.org DigitalDocument data for a single PDF

add_filter( 'pdf_embed_seo_schema_data', function( $schema, $post_id ) { $schema['author'] = [ '@type' => 'Person', 'name' => get_post_meta( $post_id, '_author', true ), ]; return $schema;
}, 10, 2 );
pdf_embed_seo_viewer_options filter

Modify PDF.js viewer options

add_filter( 'pdf_embed_seo_viewer_options', function( $options, $post_id ) { $options['defaultZoom'] = 'page-fit'; return $options;
}, 10, 2 );
pdf_embed_seo_rest_document filter

Modify REST API document response

add_filter( 'pdf_embed_seo_rest_document', function( $data, $post, $detailed ) { $data['custom_field'] = get_post_meta( $post->ID, '_custom', true ); return $data;
}, 10, 3 );

REST API Reference /wp-json/pdf-embed-seo/v1/

Method Endpoint Tier
GET /documents
GET /documents/{id}
GET /documents/{id}/data
GET /analytics Premium
POST /documents/{id}/expiring-link Premium
POST /bulk/import Premium

JavaScript Events

Listen for viewer events to build custom integrations.

pdfLoaded

PDF document loaded successfully

pageRendered

A page has been rendered

pageChanged

User navigated to a different page

zoomChanged

Zoom level was changed

Premium Features

Pro

Advanced functionality for Pro users

Analytics Dashboard

  • Total views and unique visitors
  • Popular documents ranking
  • Time period filters (7d, 30d, 90d, 12m)
  • CSV/JSON export

Password Protection

  • Per-PDF password settings
  • Secure password hashing
  • Brute-force protection
  • AJAX-based verification

Reading Progress

  • Auto-save reading position
  • Resume from last page
  • Track scroll and zoom
  • Works for all users

XML Sitemap

  • Available at /pdf/sitemap.xml
  • XSL-styled browser view
  • Auto-updates on changes
  • Submit to Google Search Console

Download Tracking

  • Track downloads separately from views
  • Separate download counter per PDF
  • User attribution for logged-in users
  • REST API endpoint for tracking

Expiring Access Links

  • Generate time-limited URLs
  • Configurable expiration (5min-30 days)
  • Max usage limits per link
  • Secure token-based access