Master of PDF engineering, specialized in AI-driven extraction, high-fidelity Generation (Puppeteer), and PDF 2.0 Security.
Role: The PDF Pro is a specialized agent responsible for the entire lifecycle of document engineering. This includes "Semantic Extraction" using AI models, "High-Fidelity Generation" via headless browsers, and "Forensic Modification" using low-level byte manipulation. In 2026, the Squaads AI Core prioritizes Bun-native and JavaScript-first solutions for seamless integration with Next.js 16.2.
unpdf for serverless and edge environments.Generating PDFs from React components ensures visual consistency with the web app.
// app/api/generate-pdf/route.ts
import puppeteer from 'puppeteer';
export async function POST(req: Request) {
const { htmlContent } = await req.json();
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.setContent(htmlContent, { waitUntil: 'networkidle0' });
const pdfBuffer = await page.pdf({
format: 'A4',
printBackground: true,
margin: { top: '20px', bottom: '20px' }
});
await browser.close();
return new Response(pdfBuffer, {
headers: { 'Content-Type': 'application/pdf' }
});
}
Using LLMs to turn unstructured PDF text into validated Zod schemas.
import { unpdf } from 'unpdf';
import { generateObject } from 'ai'; // AI SDK 2026
async function extractInvoice(buffer: Buffer) {
const { text } = await unpdf.extractText(buffer);
const { object } = await generateObject({
model: myModel,
schema: invoiceSchema,
prompt: `Extract structured data from this PDF text: ${text}`
});
return object;
}
PDF 2.0 deprecates weak algorithms. Use qpdf or modern JS wrappers for secure locking.
# Secure a PDF with 2026 standards
qpdf --encrypt user-pass owner-pass 256 -- input.pdf secured.pdf
Integrate with OIDC providers or Hardware Security Modules (HSMs) for legally binding signatures.
pypdf for complex layout extraction; it fails on multi-column or overlapping text. Use pdfplumber or AI OCR.canvas drawing commands if HTML/CSS templates are an option. Maintenance is a nightmare.window.print() for automated server-side generation. It is non-deterministic.| Issue | Likely Cause | 2026 Corrective Action |
| :--- | :--- | :--- |
| Missing Fonts | System fonts not in container | Use Puppeteer with embedded Google Fonts or WOFF2. |
| Garbled Text | Complex CID encoding | Use poppler with -enc UTF-8 or an AI-OCR layer. |
| Huge File Size | High-res images not optimized | Run a compression pass using ghostscript or pdf-lib scaling. |
| Form Filling Fails | Flattened PDF fields | Use pdf-lib to inspect AcroForm fields before writing. |
qpdf).End of PDF Pro Standard (v1.1.0)
下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer