Getting Started
Copia un prompt di configurazione con i passaggi di installazione e la guida markdown completa per questo plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-pdf-generator`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/pdf-generator/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Installazione
Sottosezione intitolata “Installazione”Puoi utilizzare la nostra configurazione assistita dall'IA per installare il plugin. Aggiungi le Capgo competenze al tuo strumento di AI utilizzando il seguente comando:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsPoi utilizza la seguente richiesta:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-pdf-generator` plugin in my project.Se preferisci l'installazione manuale, installa il plugin eseguendo i seguenti comandi e segui le istruzioni specifiche per la piattaforma riportate di seguito:
bun add @capgo/capacitor-pdf-generatorbunx cap syncImporta
Sezione intitolata “Importa”import { PdfGenerator } from '@capgo/capacitor-pdf-generator';API Panoramica
Sezione intitolata “API Panoramica”fromURL
Sezione intitolata “da URL”Genera un PDF dal URL fornito.
import { PdfGenerator } from '@capgo/capacitor-pdf-generator';
const result = await PdfGenerator.fromURL({ url: 'https://example.com' });console.log(result);fromData
Sezione intitolata “da dati”Genera un PDF da una stringa HTML cruda.
import { PdfGenerator } from '@capgo/capacitor-pdf-generator';
const result = await PdfGenerator.fromData({ data: 'data' });console.log(result);Riferimento al tipo
Sezione intitolata “Riferimento al tipo”PdfGeneratorFromUrlOptions
Sezione intitolata “PdfGeneratorFromUrlOptions”export interface PdfGeneratorFromUrlOptions extends PdfGeneratorCommonOptions { url: string;}PdfGeneratorResult
Sezione intitolata “PdfGeneratorResult”export type PdfGeneratorResult = | { type: 'base64'; base64: string; } | { type: 'share'; completed: boolean; };PdfGeneratorFromDataOptions
Sezione intitolata “PdfGeneratorFromDataOptions”export interface PdfGeneratorFromDataOptions extends PdfGeneratorCommonOptions { /** * HTML document to render. */ data: string; /** * Base URL to use when resolving relative resources inside the HTML string. * When omitted, `about:blank` is used. */ baseUrl?: string;}Punto di verità
Sezione intitolata “Punto di verità”Questa pagina è generata dal plugin’s src/definitions.ts. Re-run the sync when the public API changes upstream.
Keep going from Getting Started
Sezione intitolata “Continua da Inizia”Se stai utilizzando Getting Started per pianificare lo storage e il gestione dei file, collega Utilizza @capgo/capacitor-pdf-generator per la capacità nativa in Utilizza @capgo/capacitor-pdf-generator, @capgo/capacitor-dati-storage-sqlite per il dettaglio di implementazione in @capgo/capacitor-dati-storage-sqlite, Utilizza @capgo/capacitor-dati-storage-sqlite per la capacità nativa in Utilizza @capgo/capacitor-dati-storage-sqlite, @capgo/capacitor-file per i dettagli di implementazione in @capgo/capacitor-file, e Utilizzando @capgo/capacitor-file per la capacità nativa in Utilizzando @capgo/capacitor-file.