Skip to main content
Back to plugins
@capgo/capacitor-pdf-generator
Tutorial
by github.com/Cap-go

PDF Generator

Create PDF documents from HTML templates for invoices, reports, and receipts

Guide

Tutorial on PDF Generator

Using @capgo/capacitor-pdf-generator

Generate PDF files from HTML strings or URLs on iOS and Android.

Install

bun add @capgo/capacitor-pdf-generator
bunx cap sync

What This Plugin Exposes

  • fromURL - Generates a PDF from the provided URL.
  • fromData - Generates a PDF from a raw HTML string.

Example Usage

fromURL

Generates a PDF from the provided URL.

import { PdfGenerator } from '@capgo/capacitor-pdf-generator';

await PdfGenerator.fromURL({} as PdfGeneratorFromUrlOptions);

fromData

Generates a PDF from a raw HTML string.

import { PdfGenerator } from '@capgo/capacitor-pdf-generator';

await PdfGenerator.fromData({} as PdfGeneratorFromDataOptions);

Full Reference