はじめに
このプラグインのインストールステップとフルマークダウンガイドまでの全てのステップを含むセットアップの質問をコピーする。
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.
インストール
「インストール」のセクションbun add @capgo/capacitor-pdf-generatorbunx cap syncインポート
「インポート」のセクションimport { PdfGenerator } from '@capgo/capacitor-pdf-generator';APIの概要
「APIの概要」のセクションfromURL
URLからインポート指定されたURLからPDFを生成します。
import { PdfGenerator } from '@capgo/capacitor-pdf-generator';
await PdfGenerator.fromURL({} as PdfGeneratorFromUrlOptions);fromData
「fromData」セクション指定されたHTML文字列からPDFを生成します。
import { PdfGenerator } from '@capgo/capacitor-pdf-generator';
await PdfGenerator.fromData({} as PdfGeneratorFromDataOptions);タイプ リファレンス
「タイプ リファレンス」セクションPdfGeneratorFromUrlOptions
「PdfGeneratorFromUrlOptions」セクションexport interface PdfGeneratorFromUrlOptions extends PdfGeneratorCommonOptions { url: string;}PdfGeneratorResult
「PdfGeneratorResult」セクションexport type PdfGeneratorResult = | { type: 'base64'; base64: string; } | { type: 'share'; completed: boolean; };PdfGeneratorFromDataOptions
「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;}真実の源
「真実の源」というセクションこのページはプラグインから生成されています。 src/definitions.ts公開された API がアップストリームで変更されたら、再度同期を実行してください。