メインコンテンツへスキップ

変換する PDF に Excel

PDF4me 変換する PDF に Excel は REST テーブルとテキストを抽出するエンドポイント PDF 編集可能なものを返します Excel ワークブック。 POST 1 Base64 PDF に /api/v2/ConvertPdfToExcelドラフトまたは高品質を選択し、 OCR スキャンされたもの pages返された値を保存する .xlsx バイト単位。1回の呼び出しで、手動での再入力は不要です。

このエンドポイントの機能

1つ送信します PDF 入って、1つ手に入れる Excel ワークブックが出力されます。エンジンは各ページ上の表構造を検出し、それをスプレッドシートのセルとして再構築し、周囲のテキストを抽出します。 qualityType 高速テキスト層抽出を切り替える(下書き)およびスキャンごとのページ認識(高い)、 そして ocrWhenNeeded 走る OCR ページにテキスト レイヤーがない場合、自動的に実行されます。レスポンスは生のデータです。 .xlsx バイナリ(200)または Location 投票 URL (202)

関連ブログ記事
この機能に関するブログ記事はまだありません。近日公開予定です。
その間、PDF4me ブログを閲覧して、あらゆるプラットフォームのチュートリアルやワークフローをご覧ください。
ブログをご覧ください →

認証 API リクエスト​

毎 PDF4me REST 電話にはあなたの API キー Authorization ヘッダーを基本認証として設定します。開発者ダッシュボードからキーを取得またはローテーションしてください。

終点​

POST/api/v2/ConvertPdfToExcel

見逃してはならない重要な事実​

ドラフトとハイは料金が異なります
ドラフト費用1 API ファイルごとに呼び出し、既存のテキストレイヤーを読み取ります。高コスト 2 API ページごとに呼び出しを行い、すべてのページを再処理します。これがスキャンされた PDFs 作業。クリーンなデジタルで高出力を実行しないでください PDFs; 何も得られないのに、ページごとに料金を支払うことになる。
outputFormat そして ocrWhenNeeded ブール値です
公式コードサンプルが送信します 真実 / 間違い JSON 両方のフィールドにブール値を使用します。このページの古いバージョンでは、次のような文字列値が表示されていました。 "はい"以下のサンプルにあるように、ブール値を使用してください。
Async 202 + を返します Location ヘッダー
と 非同期: true の API 202で応答する可能性がある Location ヘッダー。 GET それ URL (同じ Authorizationワークブックバイナリで200が返されるまで、)処理を続けます。公式サンプルでは、10秒ごとにポーリングを行い、最大10回再試行します。

HTTP 設定​

方法: POST
URL: https://api.pdf4me.com/api/v2/ConvertPdfToExcel
コンテンツタイプ: アプリケーション/json
Authorization: 基本 <あなたの PDF4me API キー>

送信 非同期: true 体内で。 200 変換されたものを返します .xlsx ワークブックをバイナリバイトとして保存します。 202 を返します Location アンケート付きのヘッダー URL; GET それ URL 同じ Authorization ワークブックバイナリで200が返されるまでヘッダーを実行します。

画質モードは「ドラフト」と「高画質」のどちらを選択すべきですか?​

Draftは、デジタルで作成されたテキストレイヤー内に既に存在するテキストレイヤーを読み取ります。 PDF高解像度モードでは、すべてのページを再レンダリングして認識するため、処理速度は遅く、コストも高くなりますが、スキャン画像、文書の写真、画像のみに対応する唯一のモードです。 pages。

ドラフト対ハイ下書き高い
最適デジタルで作成された PDFs 選択可能なテキスト付きスキャンまたは画像ベース PDFs
料金1 API ファイルごとの呼び出し2 API ページあたりの呼び出し回数
OCR適用されませんページごとに適用(ペア) ocrWhenNeeded: true)
スピード高速、シングルパスページごとの認識速度が遅い
テーブルが空になったとき高画質で再試行チェック language テキストが文字化けしている場合

API ボディフィールド​

パラメータ必須その機能例
jobIdExtOptionalYour own reference for this call. It is stored with the API call log so you can correlate calls with your jobs. Type: string.
integrationsOptionalIntegration identifiers, forwarded unchanged with the job's notification settings. Type: array.
isAsyncOptionalSet to `true` to process the action asynchronously and get a job to poll at `/api/v2/GetActionStatus`. Only honoured by actions that support asynchronous processing. Type: boolean.true
docNameOptionalSource file name including its extension. Several actions dispatch on the extension, so it should always be set; when omitted a per-action default is used. Type: string.invoice-report.pdf
docContentRequiredThe source file. Accepts the base64-encoded file content, a `pdf4meblobid://<id>` reference to a previously uploaded blob, or an `https` URL to the source document. Required: an empty value fails with `File is empty`. Type: string.JVBERi0xLjcK...
docContentBytesOptionalAlternative raw byte payload for the source file. Type: string.
callBackUrlOptionalOptional URL notified when an asynchronous job completes. Type: string.
qualityTypeOptionalConversion quality. An unrecognised value is rejected with 400. Type: string.Draft
ocrWhenNeededOptionalParsed as a boolean: pass `true` to run OCR when the source PDF has no text layer. Used by ConvertOcrPdf. Type: string.true
mergeAllSheetsOptionalConvertPdfToExcel: put every page into a single worksheet. Type: boolean.true
languageOptionalOCR language, for example `English`. Type: string.English
outputFormatOptionalUsed by ConvertPdfToExcel: set to `csv` to receive CSV instead of a workbook, and by ConvertVisio to pick the target format. Type: string.true

サンプルペイロード​

下書きモード。デジタル PDF 選択可能なテキスト付き​

{
"docContent": "JVBERi0xLjcKJcfsj6IKNSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZw...",
"docName": "invoice-report.pdf",
"qualityType": "Draft",
"mergeAllSheets": true,
"outputFormat": true,
"ocrWhenNeeded": true,
"async": true
}

ハイモード。スキャン済み PDF と OCR​

{
"docContent": "JVBERi0xLjcKJcfsj6IKNSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZw...",
"docName": "scanned-statement.pdf",
"qualityType": "High",
"mergeAllSheets": false,
"language": "English",
"outputFormat": true,
"ocrWhenNeeded": true,
"async": true
}

郵便配達員の集荷に関するヒント​

Headers
Content-Type: application/json + Authorization: Basic <apiKey>.
Body
raw JSON. Copy one of the payloads above and replace docContent with your Base64.
Response
Use Send and Download so Postman saves the binary body as a .xlsx file when status is 200. If 202, GET the Location URL with the same Authorization until 200.
Quality
Start with Draft. Only switch to High when tables come back empty, and expect 2 API calls per page in that mode.

curlの例​

curl -X POST https://api.pdf4me.com/api/v2/ConvertPdfToExcel \
-H "Content-Type: application/json" \
-H "Authorization: Basic YOUR_API_KEY" \
-d '{
"docContent": "'"$(base64 -w 0 invoice-report.pdf)"'",
"docName": "invoice-report.pdf",
"qualityType": "Draft",
"mergeAllSheets": true,
"outputFormat": true,
"ocrWhenNeeded": true,
"async": true
}' \
--output converted.xlsx

何が API 戻る?​

変換が成功すると、 Excel ワークブック自体ではなく、 JSON ラッパー。出力はモダンな オフィス営業中 XML ワークブック(.xlsx)デフォルト XML-ベースのフォーマット すべての現行バージョンでサポートされています Excel以下の3つのケースに対応してください。

分野タイプ内容物
Response body (HTTP 200)BinaryThe converted .xlsx workbook bytes. Write them straight to a file with an .xlsx extension.
Location header (HTTP 202)String (URL)Poll URL for an async job that is still running. GET it with the same Authorization header.
Poll response (HTTP 200)BinaryThe finished workbook, returned once processing completes. The official samples poll every 10 seconds, up to 10 retries.
Poll response (HTTP 202)EmptyJob still processing. Wait and poll the same Location URL again.

コードサンプル​

エンドツーエンドの実装例(それぞれサンプル付き) PDF そして、このページからの正確なペイロードは次のとおりです。

よくある質問​

Which quality mode should I choose, Draft or High?+
Draft is for digitally created PDFs with a real text layer and costs 1 API call per file. High is for scanned or image-based PDFs and costs 2 API calls per page. Start with Draft; switch to High only when tables come back empty or garbled.
Can the API extract tables from a scanned PDF?+
Yes. Set qualityType to High and ocrWhenNeeded to true. The engine runs OCR on pages without a text layer and reconstructs detected tables as spreadsheet cells in the output workbook.
What does mergeAllSheets do?+
With mergeAllSheets true the extracted content is combined into a single worksheet. With false, content is kept on separate worksheets, so a multi-page PDF maps to multiple sheets in the workbook.
When do I need the language field?+
Only when the converted output is not recognizable. The engine detects the document language automatically; set language explicitly when recognition returns garbled text for your source language.
Is the response JSON or the file itself?+
The file itself. A 200 response body is the raw .xlsx binary. Do not JSON-parse it; write the bytes to disk. Only the 202 case involves reading a header (Location) instead of the body.
My tables came back as plain text without cell structure. What now?+
Rerun with qualityType High so each page goes through recognition, and keep ocrWhenNeeded true. If the text itself is garbled rather than misplaced, set the language field to match the document.
How large can the PDF be?+
Large and scanned files are exactly what the async pattern is for. Send async true and be prepared to poll the Location URL; the official samples poll every 10 seconds, up to 10 retries, before timing out.
Can I get XLS instead of XLSX?+
No. The endpoint returns a modern Open XML workbook (.xlsx). Legacy .xls output is not offered; every current version of Excel, LibreOffice, and Google Sheets opens .xlsx.

関連アクション​

他のプラットフォームでも同じタスクを実行​

ヘルプが必要な場合​