GitBook to PDF: When the Docs Site Itself Is the Problem

GitBook used to ship PDF export.
Then it didn't.
Then they brought it back, paywalled.
If you've ever needed an offline copy of GitBook-hosted docs, you've been on this rollercoaster. The product is great for live, collaborative documentation. The "I want a PDF" story has been less great.
Here's the universal workaround.
Table of Contents
- The GitBook PDF Saga
- Why Public GitBook Spaces Are Awkward Offline
- The OfflineDocs Workflow
- When GitBook Stays the Right Tool
- What Works (and What Doesn't)
- A Real Use Case: API Docs Hosted on GitBook
- A Note on Self-Hosted GitBook
- Comparison: GitBook vs ReadMe vs Custom
- The OfflineDocs Workflow
- When GitBook Stays the Right Tool
- What Works (and What Doesn't)
- A Real Use Case: API Docs Hosted on GitBook
- A Note on Self-Hosted GitBook
- Comparison: GitBook vs ReadMe vs Custom
- Generate Your GitBook PDF
The GitBook PDF Saga
Brief history (most readers have lived this):
- Early GitBook: free PDF export, worked fine
- GitBook Cloud rewrite: PDF export removed
- Customer demand: "we need PDF export"
- GitBook: PDF export returns, gated behind paid tiers
- Free tier users: still no good native option
This isn't a knock on GitBook. They're running a business. Paid PDF export is reasonable.
But if you're a consumer of GitBook-hosted docs (you didn't choose the platform; the API you depend on did), the paywalled path doesn't help you. You just want to read the API docs offline.
That's where OfflineDocs fits.

Why Public GitBook Spaces Are Awkward Offline
GitBook's online experience is great. Sidebar nav, fast search, clean typography.
It's also a SPA, which means:
- Browser "save as PDF" gives you one page, not the whole space
- Print stylesheets are decent but the hierarchy gets flattened
- Cross-page links don't survive a browser-side print
- Tables of contents in the printed PDF are missing or wrong
The same SPA-docs problem we covered for TanStack: great UX online, hostile offline.

The OfflineDocs Workflow
OfflineDocs treats a GitBook space like any other docs site:
- Paste the public GitBook URL:
https://your-team.gitbook.io/space-name - Generate
The crawler walks the GitBook space, preserves the page tree as chapter structure, generates a real PDF with a real TOC.
Same from-url method as the GitHub README to PDF workflow and the Notion handbook flow. One paste.

When GitBook Stays the Right Tool
GitBook's value isn't PDF export. It's:
- Live editing
- Branching (drafts, reviews)
- Collaboration on docs
- API integrations for syncing with code repos
If you're publishing docs on GitBook, GitBook is doing exactly what it should. Don't migrate just because PDF export is awkward.
The flow is: GitBook for publishing, OfflineDocs for consuming. Two different jobs.

What Works (and What Doesn't)
| GitBook feature | PDF result |
|---|---|
| Headings, paragraphs | Perfect |
| Code blocks (with language) | Perfect |
| Hint blocks (info, warning, danger) | Render as styled blocks |
| Tabs | Flatten to sequential sections |
| Embeds (YouTube, CodeSandbox) | Linked, not embedded |
| Mermaid / sequence diagrams | Render where supported |
| Files / attachments | Linked |
| API references (built-in) | Render as structured tables |
| Search | Use the PDF reader's search |
| Variables / page expressions | Resolved at export time |
The 90% you care about works. The 10% (live embeds, tabs that compress to lists) is a small loss.

A Real Use Case: API Docs Hosted on GitBook
Half the API docs in the wild live on GitBook these days. Stripe-style docs get the headlines, but most B2B SaaS APIs use GitBook.
For consumers: you want the API reference offline. You probably don't have GitBook paid tier access for the company's docs (you're not their customer for GitBook, you're their customer for the API).
OfflineDocs handles this. Paste the public GitBook URL → generate → API reference on your laptop.
This is one of the reasons the API documentation PDF story is broader than it looks. The substrate (GitBook, ReadMe, custom) doesn't matter — the consumer's need for an offline reference is the same.
A Note on Self-Hosted GitBook
GitBook used to have a self-hosted option (gitbook-cli). It's deprecated.
If you're maintaining old gitbook-cli-built sites, those generate static HTML you can crawl with from-url directly. Or feed the source Markdown folder to from-markdown.
Either flow works. The gitbook-cli ecosystem is small now, but it lingers.
Comparison: GitBook vs ReadMe vs Custom
The "API docs hosting" space has three big players:
| Platform | What they're good at | Offline story |
|---|---|---|
| GitBook | Live editing, branching | Paywalled native, OfflineDocs handles it |
| ReadMe | Interactive playgrounds | No native PDF, OfflineDocs handles it |
| Self-hosted (Docusaurus, Astro Starlight, MkDocs) | Customization | No native PDF, OfflineDocs handles it |
OfflineDocs is platform-agnostic. Wherever the docs live publicly, paste the URL.
For a deeper take on ReadMe specifically, there's a separate comparison.
The OfflineDocs Workflow
OfflineDocs treats a GitBook space like any other docs site:
- Paste the public GitBook URL:
https://your-team.gitbook.io/space-name - Generate
The crawler walks the GitBook space, preserves the page tree as chapter structure, generates a real PDF with a real TOC.
Same from-url method as the GitHub README to PDF workflow and the Notion handbook flow. One paste.
When GitBook Stays the Right Tool
GitBook's value isn't PDF export. It's:
- Live editing
- Branching (drafts, reviews)
- Collaboration on docs
- API integrations for syncing with code repos
If you're publishing docs on GitBook, GitBook is doing exactly what it should. Don't migrate just because PDF export is awkward.
The flow is: GitBook for publishing, OfflineDocs for consuming. Two different jobs.
What Works (and What Doesn't)
| GitBook feature | PDF result |
|---|---|
| Headings, paragraphs | Perfect |
| Code blocks (with language) | Perfect |
| Hint blocks (info, warning, danger) | Render as styled blocks |
| Tabs | Flatten to sequential sections |
| Embeds (YouTube, CodeSandbox) | Linked, not embedded |
| Mermaid / sequence diagrams | Render where supported |
| Files / attachments | Linked |
| API references (built-in) | Render as structured tables |
| Search | Use the PDF reader's search |
| Variables / page expressions | Resolved at export time |
The 90% you care about works. The 10% (live embeds, tabs that compress to lists) is a small loss.

A Real Use Case: API Docs Hosted on GitBook
Half the API docs in the wild live on GitBook these days. Stripe-style docs get the headlines, but most B2B SaaS APIs use GitBook.
For consumers: you want the API reference offline. You probably don't have GitBook paid tier access for the company's docs (you're not their customer for GitBook, you're their customer for the API).
OfflineDocs handles this. Paste the public GitBook URL → generate → API reference on your laptop.
This is one of the reasons the API documentation PDF story is broader than it looks. The substrate (GitBook, ReadMe, custom) doesn't matter — the consumer's need for an offline reference is the same.
A Note on Self-Hosted GitBook
GitBook used to have a self-hosted option (gitbook-cli). It's deprecated.
If you're maintaining old gitbook-cli-built sites, those generate static HTML you can crawl with from-url directly. Or feed the source Markdown folder to from-markdown.
Either flow works. The gitbook-cli ecosystem is small now, but it lingers.
Comparison: GitBook vs ReadMe vs Custom
The "API docs hosting" space has three big players:
| Platform | What they're good at | Offline story |
|---|---|---|
| GitBook | Live editing, branching | Paywalled native, OfflineDocs handles it |
| ReadMe | Interactive playgrounds | No native PDF, OfflineDocs handles it |
| Self-hosted (Docusaurus, Astro Starlight, MkDocs) | Customization | No native PDF, OfflineDocs handles it |
OfflineDocs is platform-agnostic. Wherever the docs live publicly, paste the URL.
For a deeper take on ReadMe specifically, there's a separate comparison.
Generate Your GitBook PDF
offlinedocs.ai/new → paste any public GitBook URL → generate.
Two minutes. One PDF. Zero rollercoaster.
GitBook for the writer. OfflineDocs for the reader. Both win.
Ready to Get Started?
Start creating your Offline Docs Now! Reduce screen time and save your eyes.