Act as a senior WordPress plugin developer.
Create a production-ready WordPress plugin that generates branded PDF files dynamically from WordPress posts using the mPDF library.
Website: Atlas Agni Taj
Stack:
WordPress
Elementor
Custom Post Type: Insights (or standard Posts)
PHP 8+
mPDF library
When a visitor clicks the “Download PDF” button on an article page, the system should generate a professional PDF automatically from the article content.
No static PDFs should be uploaded manually.
The PDF should be generated in real time from the current article.
Include:
Atlas Agni Taj Logo
Article Title
Publication Date
Category
Header should appear on every page.
Include:
London · Dubai · Riyadh · Gurgaon
atlasagnitaj.com
Page Number
Footer should appear on every page.
Pull dynamically from WordPress:
Post Title
Featured Image
Post Content
Categories
Tags
Render Elementor content correctly.
Support:
Headings
Paragraphs
Lists
Tables
Images
Blockquotes
Create professional enterprise styling:
White background
Dark navy headings
Gold accent lines
Responsive image sizing
Clean typography
Proper page breaks
Create endpoint:
/pdf/{post-id}
Example:
When accessed:
Load post
Build PDF
Stream PDF download
Provide shortcode:
[pdf_download_button]
Automatically detect current post ID.
Create WordPress admin page:
Settings → Atlas PDF
Options:
Upload Logo
Company Name
Footer Text
Primary Colour
Secondary Colour
Store settings using WordPress Settings API.
Validate post ID
Sanitize output
Escape all fields
Restrict unpublished posts
Cache generated PDFs
Regenerate only when article updates
Store cached PDFs in wp-content/uploads/pdf-cache/
Generate:
Complete plugin folder structure
All PHP files
Plugin bootstrap file
mPDF integration
Admin settings page
Shortcodes
Endpoint registration
CSS styling
Installation instructions
Example Elementor button configuration
Use WordPress coding standards and OOP architecture.
Output complete code files with explanations.