Importing PDF
PDF import goes through LlamaParse — layout-aware extraction that handles tables, multi-column layouts, and scanned (OCR) documents. Counts against your AI quota.
PDFs convert server-side via /api/ai/convert-pdf, which uses LlamaParse for layout-aware extraction. We chose LlamaParse over a local PDF.js extraction because real-world PDFs (multi-column papers, scanned forms, table-heavy reports) need actual layout reconstruction — and a local fallback would be worse, so we don’t bother.
What LlamaParse handles well
- Multi-column layouts — academic papers, magazines — read in the correct order
- Tables — recovered as proper Markdown tables when the layout is clear
- Mixed text + scanned pages — OCR runs on the scanned pages, native text extracted from the rest
- Lists and indentation — paragraph hierarchy preserved
- Code-like blocks — monospaced sections become fenced code blocks
- Page boundaries — joined into continuous Markdown without page-number litter
What’s harder
| Type | Result |
|---|---|
| Forms with overlapping fields | OK, but read-order may need cleanup |
| Heavy graphics / diagrams | Replaced with placeholder image markers or dropped |
| Math equations (rendered as text) | Captured as text approximation; full LaTeX is not recovered |
| Two-page spreads at full bleed | Read column by column; layout reconstruction depends on the PDF’s text frames |
| Watermarks / page numbers / headers/footers | Best-effort filtered out; some may remain |
| Right-to-left scripts | Supported; quality depends on the source font |
Auth and quota
PDF import is not anonymous — you must be signed in. The endpoint enforces:
- A monthly quota (PDF imports count against the same AI quota as AI Author and RTF imports; see Plans for tier limits)
- A per-file size cap (25 MB — same as the import pipeline)
- Per-user rate limiting on the conversion endpoint
If you hit the quota mid-import, the error message tells you what plan resets are available:
Conversion quota reached for this month. Pro raises the cap.
How the import looks
PDFs aren’t instant — typical conversion takes a few seconds per page. The pipeline:
- You drop the PDF; sweetdocs uploads it to
/api/ai/convert-pdfwith your auth token - The server queues a LlamaParse job
- Progress flows back as the response streams; the doc is created on success
- The Markdown body lands in the new document; the title is the filename minus
.pdf
Warnings from the converter (e.g., “page 4 had no extractable text”) show as a toast and are recorded in the doc — usually as a placeholder where the page would have gone.
What you’ll see in the result
- Headings derived from font-size hierarchy in the source PDF (not always perfect — feel free to adjust)
- Tables in GFM pipe format
- Paragraphs broken by visual layout, not arbitrary line-wrap
- Images embedded inline if LlamaParse extracts them (varies by PDF)
Cleanup tips after a PDF import
PDF source varies widely. After import, the AI Author panel is the quickest cleanup tool:
- “Remove the page-header repetitions”
- “Merge fragmented paragraphs”
- “Promote the table-of-contents lines into proper headings”
What’s not in v1
| Missing | Notes |
|---|---|
| Selecting specific page ranges to import | Whole file converts |
| OCR language hints | LlamaParse auto-detects |
| Form-field extraction as structured data | Forms come through as text |
| Watermark removal | Best-effort only |
| Hyperlink preservation from PDF annotations | Usually retained, but quality varies |