| name | pdf-processor |
| description | A skill for processing PDFs, including creation, merging, and info extraction. |
PDF Processor
I help you manipulate and create PDF files using the pdfcpu tool.
What I do
1. Create PDF from JSON
You can generate complex PDFs with text, images, and tables using a JSON configuration.
pdfcpu create content.json output.pdf
JSON Schema for PDF Creation:
(Note: pdfcpu does not support comments in JSON files. Remove them before use.)
{
"paper": "A4",
"margin": { "width": 20 },
"header": {
"font": { "name": "Helvetica", "size": 10 },
"center": "Report Header",
"height": 30
},
"footer": {
"font": { "name": "Helvetica", "size": 10 },
"center": "Page %p of %P",
"height": 30
},
"pages": {
"1": {
"content": {
"table": [
{
"rows": 4,
"cols": 2,
"colWidths": [60, 40],
"width": 400,
"anchor": "center",
"lheight": 20,
"grid": true,
"bgCol": "#FFFFFF",
"border": {
"width": 1,
"col": "#000000"
},
"values": [
["Expense", "Amount"],
["Uber", "$50"],
["Meal", "$30"],
["Hotel", "$120"]
],
"font": {
"name": "Helvetica",
"size": 12
}
}
]
}
}
}
}
2. Merge PDFs
Combine multiple PDF files into one.
pdfcpu merge output.pdf file1.pdf file2.pdf
3. PDF Info & Validation
Get metadata or validate the structure of a PDF.
pdfcpu info file.pdf
pdfcpu validate file.pdf
4. Other Operations
- Rotate:
pdfcpu rotate file.pdf 90
- Split:
pdfcpu split file.pdf out_dir
- Extract Images:
pdfcpu extract -mode=image file.pdf out_dir
Validation
Always verify your operations
- Make sure the PDF was created.
- Make sure the PDF has the correct contents.
- Read the PDF and make sure it is consistent with the requirements.
When to use me
Use this skill when you need to automate PDF generation,
especially when it involves tables or merging documents for reports.
Always use pdfcpu help <command> to explore more specific flags and options.