The Highlite Pro plugin includes robust export features to give users full control over their saved highlights. Users can either print their highlights as a clean HTML page or download them as a formatted DOCX file—complete with notes and links.
📥 DOCX Download Functionality #
🔧 How It Works #
- Each highlight group (per post) can be downloaded as a
.docx
document. - The DOCX file includes:
- The post title (as a hyperlink)
- A list of highlights with their attached notes
- The internal HTML is embedded into the document using Microsoft Word’s altChunk method.
🧠 Technical Details #
- The file is dynamically generated via PHP using the
ZipArchive
class. - DOCX parts created:
[Content_Types].xml
document.xml
(references altChunk)htmlData.html
(user highlights in HTML format)
📌 Prerequisite: Your server must support
ZipArchive
.
🔐 Security #
- The DOCX download is protected using a nonce (
_nonce
GET parameter). - Only the logged-in user who owns the highlights can download them.
🖨️ Print Highlights (HTML View) #
🧾 What Users See #
- Clicking the print icon (🖨️) opens a new print-friendly HTML page in the browser.
- It shows:
- Post title (with link)
- Each highlight with its note
- Styled layout using clean CSS (no WordPress theme interference)
📄 Output Styling #
The print page uses simple, readable formatting:
body { font-family: sans-serif; padding: 20px; }
h1 { margin-bottom: 20px; }
ul { list-style: none; padding: 0; }
li { margin-bottom: 20px; }
strong { font-weight: bold; }
🖱️ Triggering the Print #
- The browser’s native print dialog appears automatically on page load using:
<script>window.print();</script>
🔐 Security & Access #
- The print URL includes a unique
nonce
to prevent unauthorized access. - Highlights are fetched only for the current logged-in user.
🌐 Accessing Print & Download #
From the [highlite_list]
table, each row (post) includes:
- 📥 DOCX download icon
- 🖨️ Print icon
These features offer offline usability and integration with classroom/meeting notes, legal reviews, research archives, etc.
⚠️ Troubleshooting Tips #
Issue | Solution |
---|---|
DOCX file is corrupted or unreadable | Ensure ZipArchive PHP extension is enabled on your server |
Print page shows “Please log in” | User must be logged in with valid nonce |
Download doesn’t start | Check browser popup blockers or network errors |