はじめから始める
このプラグインのインストール手順とマークダウンガイドを含むセットアッププロンプトをコピーします。
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.
Install
「インストール」のセクションAI-Assisted セットアップを使用してプラグインをインストールできます。AI ツールに Capgo スキルを追加するには、以下のコマンドを実行してください。
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins次に、以下のプロンプトを使用してください:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-pdf-generator` plugin in my project.Manual Setupを使用する場合は、以下のコマンドを実行して、下記のプラットフォーム固有の指示に従ってください:
bun add @capgo/capacitor-pdf-generatorbunx cap syncインポート
「インポート」のセクションimport { PdfGenerator } from '@capgo/capacitor-pdf-generator';APIの概要
「APIの概要」のセクションfromURL
「fromURL」のセクションURLからPDFを生成します。
import { PdfGenerator } from '@capgo/capacitor-pdf-generator';
await PdfGenerator.fromURL({} as PdfGeneratorFromUrlOptions);fromData
セクション:fromDataHTML文字列からPDFを生成します。
import { PdfGenerator } from '@capgo/capacitor-pdf-generator';
await PdfGenerator.fromData({} as PdfGeneratorFromDataOptions);型の参照
セクション:型の参照PdfGeneratorFromUrlOptions
セクション:PdfGeneratorFromUrlOptionsexport interface PdfGeneratorFromUrlOptions extends PdfGeneratorCommonOptions { url: string;}PdfGeneratorResult
セクション:PdfGeneratorResultexport type PdfGeneratorResult = | { type: 'base64'; base64: string; } | { type: 'share'; completed: boolean; };PdfGeneratorFromDataOptions
セクション:PdfGeneratorFromDataOptionsexport 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.tsAPIの公開変更がアップストリームで発生した場合に再度同期を実行してください。
Getting Startedから続けてください
「Getting Startedから続けてください」セクションCapacitorを使用している場合 Getting Started ストレージとファイルハンドリングを計画するために使用している場合、Capacitorを Using @capgo/capacitor-pdf-generator Using @capgo/capacitor-pdf-generator @capgo/capacitor-data-storage-sqlite for the implementation detail in @capgo/capacitor-data-storage-sqlite Using @capgo/capacitor-data-storage-sqlite for the native capability in Using @capgo/capacitor-data-storage-sqlite @capgo/capacitor-file for the implementation detail in @capgo/capacitor-file, and Using @capgo/capacitor-file for the native capability in Using @capgo/capacitor-file