Loading...
Loading...
Build RAG / unstructured-document evaluation datasets and demo documents (e.g. for Knowledge Assistant) on Databricks: generate synthetic PDFs locally, upload to Unity Catalog volumes, and pair each document with test questions for retrieval evaluation.
npx skill4agent add databricks/databricks-agent-skills databricks-unstructured-pdf-generationai_extractai_parse_document./raw_data/html/<SKILL_ROOT>/scripts/pdf_generator.pyplutoprintdatabricks fs cp./raw_data/pdf/pdf_eval_questions.jsonmlflow.genai.evaluate()If you only need ad-hoc PDFs (no Databricks workflow), any HTML → PDF tool (,weasyprint,wkhtmltopdf,playwright pdf) works directly — this skill exists for the synthetic-dataset-on-UC end-to-end shape, not as a general PDF generator.plutoprint
Path convention:below = the directory containing this SKILL.md. Resolve to the absolute install path (e.g.<SKILL_ROOT>).~/.claude/skills/databricks-unstructured-pdf-generationpaths are relative to your own project cwd../raw_data/...
uv pip install plutoprintmkdir -p ./raw_data/html./raw_data/html/filename.html# Convert entire folder (parallel, 4 workers)
python <SKILL_ROOT>/scripts/pdf_generator.py convert --input ./raw_data/html --output ./raw_data/pdf--forcedatabricks fsdbfs:-rraw_data/pdfraw_data/pdf/dbfs:/Volumes/my_catalog/my_schema/raw_data/pdf/report.pdfdatabricks fs cp -r --overwrite ./raw_data/pdf dbfs:/Volumes/my_catalog/my_schema/raw_data/pdf./raw_data/pdf/pdf_eval_questions.json{
"api_errors_guide.pdf": {
"question": "What is the solution for error ERR-4521?",
"expected_fact": "Call /api/v2/auth/refresh with refresh_token before the 3600s TTL expires"
},
"installation_manual.pdf": {
"question": "What port does the service use by default?",
"expected_fact": "Port 8443 for HTTPS, configurable via CONFIG_PORT environment variable"
}
}/api/v2/auth/refreshpython <SKILL_ROOT>/scripts/pdf_generator.py convert [OPTIONS]
--input, -i Input HTML file or folder (required)
--output, -o Output folder for PDFs (required)
--force, -f Force reconvert (ignore timestamps)
--workers, -w Parallel workers (default: 4)./raw_data/html/ ./raw_data/pdf/
├── report.html → ├── report.pdf
├── quarterly/ ├── quarterly/
│ └── q1.html → │ └── q1.pdf
└── legal/ └── legal/
└── terms.html → └── terms.pdf| File | Description |
|---|---|
| scripts/pdf_generator.py | HTML → PDF converter (wraps |
<SKILL_ROOT>/scripts/pdf_generator.pyconvert--input--output--force--workersplutoprint| Issue | Solution |
|---|---|
| "plutoprint not installed" | |
| PDF looks wrong | Check HTML/CSS syntax |
| "Volume does not exist" | |