# Anvil PDF Generation API

An API developers and agents can call to generate PDFs on the fly. Convert HTML and CSS or Markdown to PDF. Get started with 2,500 free credits; bulk discounts and priority support come with the Paid Plan.

## 2 ways to generate perfectly formatted PDFs

Our PDF API creates dynamic and variable length documents based on your content.

### HTML to PDF

Use custom HTML and CSS to lay out and generate your PDF for a 100% pixel perfect document. See the [PDF generation documentation](/docs/api/generate-pdf/) when ready to generate your own.

### Markdown to PDF

A quick way to get your content into a PDF. Expanded markdown syntax allows for tables, giving you powerful formatting flexibility.

## Integrate your preferred language using Anvil's MCP

Official SDKs ship with typed models, streaming download support, and a dedicated guide with runnable code for the most common PDF jobs. See [all languages](/products/languages/) and the [MCP setup guide](/mcp/).

## PDF Generation API FAQs

### How do I generate a PDF from HTML with Anvil?

POST HTML and CSS strings to /api/v1/generate-pdf to receive a rendered PDF. Works with full CSS, custom fonts \(TTF only\), page headers and footers, and fillable forms.

### Can I use Markdown to generate PDFs?

Yes. POST Markdown to the same /api/v1/generate-pdf endpoint. Anvil applies a default theme, or you can pass your own CSS.

### Can I use custom fonts?

Yes. Reference custom fonts via @font-face. Per [Anvil's PDF generation docs](/docs/api/generate-pdf/), only TTF format is supported at this time \(OTF and WOFF are not yet supported\).

### Does it support headers, footers, and page numbers?

Yes. Standard CSS paged-media properties are supported, including helpers for page numbers and fixed-margin content.

### How is Anvil different from DocRaptor, PandaDoc, or Puppeteer?

Anvil is API-first and bundles [PDF filling](/products/pdf-filling-api/), PDF generation, [Etch e-sign](/products/etch/), and Webforms in one platform. DocRaptor is an HTML-to-PDF \(and Excel\) conversion API built on PrinceXML. PandaDoc is a document management platform with an API focused on proposals, contracts, and e-signatures. Puppeteer is an open-source Node.js library for headless-browser automation that you self-host.

## Need more than PDF generation?

Anvil is more than a PDF tool. We specialize in helping product teams build custom paperwork solutions using these building blocks: [PDF services](/products/pdf-services/), [E-signatures](/products/etch/), and [Webforms](/products/webforms/). Anvil [Workflows](/products/workflows/) tie all these building blocks together, automating your paperwork and saving your team time and resources.

Why product teams choose Anvil:

- **Easy to implement**: Empower your non-technical folks to participate in the document set-up.
- **Launch faster**: Start filling or generating PDFs in less than a day using our no-code tools and pro-code docs.
- **Scalable**: Create thousands of PDFs that scale with your usage needs.

## Integrate with Zapier

Build Zapier workflows to automate paperwork processes end-to-end with Anvil. [Learn more](https://zapier.com/apps/anvil/integrations).

You can:

- [Fill a PDF](/help/tutorials/fill-a-pdf-using-zapier/)
- [Set up an Anvil Workflow trigger](/help/tutorials/set-up-anvil-workflow-trigger-with-zapier/)
- [Start & pre-fill an Anvil Workflow](/help/tutorials/start-and-prefill-anvil-workflow-from-zapier/)
- [Create a link to an Anvil submission](/help/tutorials/link-to-anvil-submission-with-zapier/)

## Secure, compliant, reliable

Anvil uses digital certificates, specifically the industry-standard [Public Key Infrastructure](/blog/engineering/how-digital-e-signatures-work/#2-public-key-infrastructure-pki) (PKI) framework, for identity verification in document signing. This involves creating a pair of certificates – public and private.

Documents signed on Anvil are encrypted with a 2048 RSA private key stored in a secure Hardware Security Module (HSM), ensuring no unauthorized access, including by Anvil developers.

Signatures can be verified using a PDF viewer that supports signature verification.

Anvil is proud of our industry-leading reliability with 99.99% uptime.

## Related Resources
- [PDF Generation API](/docs/api/generate-pdf.md): Generate new PDFs from HTML and CSS or Markdown with one API call.
- [Getting Started with the Anvil API](/docs/api/getting-started.md): Authentication, terminology, and first steps with the Anvil API.
- [Anvil PDF Filling API](/products/pdf-filling-api.md): Turn any PDF into an API-fillable template and fill it with a single request – the PDF tool your agents and developers call.
- [Anvil Pricing Plans](/pricing.md): View all available plans, features, and pricing details.
