パッケージのインストール

次に、次のコードスニペットに示すように、npm installコマンドを使用していくつかのパッケージをインストールします。

{
    "name": "adobedocumentservicesapis",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "directories": {
    "test": "test"
    },
    "dependencies": {
    "body-parser": "^1.19.0",
    "config": "^3.3.6",
    "express": "^4.17.1",
    "hbs": "^4.1.1",
    "mongoose": "^5.12.1",
    "morgan": "^1.10.0",
    "multer": "^1.4.2",
    "path": "^0.12.7"
    },
    "devDependencies": {},
    "scripts": {
    "start": "set NODE_ENV=dev && node index.js"
    },
    "repository": {
    "type": "git",
    "url": "git+https://github.com/agavitalis/AdobeDocumentServicesAPIs.git"
    },
    "author": "Ogbonna Vitalis",
    "license": "ISC",
    "bugs": {
    "url": "https://github.com/agavitalis/AdobeDocumentServicesAPIs/issues"
    },
    "homepage": "https://github.com/agavitalis/AdobeDocumentServicesAPIs#readme"
}
###bash
npm install express mongoose config body-parser morgan multer hbs path pdf-parse
Ensure that the content of your package.json file is similar to this code snippet:
###package.json
{

これらのコードスニペットは、ビューのHandlebarsテンプレートエンジンなどのアプリケーション依存関係をインストールします。 scriptsタグで、アプリケーションの実行時パラメーターを設定します。

Acrobat Services APIを統合しています

Acrobat Servicesには次の3つのAPIが含まれています:

  • Adobe PDF Services API

  • Adobe PDF Embed API

  • Adobe文書生成API

これらのAPIにより、一連のクラウドベースのWebサービスを介してPDFコンテンツの生成、操作、変換が自動化されます。

資格情報を取得するには、登録してワークフローを完了する必要があります。 PDF埋め込みAPIは無料で使用できます。 PDFサービスAPIとDocument Generation APIは6か月間無料で利用できます。 体験版が終了すると、1つのドキュメントトランザクションにつき従量課金制で課金されます。 お客様の会社が成長し、より多くの契約を処理するにつれて、お支払いいただきます。

資格情報の作成のスクリーンショット

サインアップが完了すると、API資格情報を含むコードサンプルがPCにダウンロードされます。 このコード例を展開し、 private.keyとpdftools-api-credentials.jsonファイルをアプリケーションのルートディレクトリに配置します。

次に、アプリケーションのルートディレクトリでターミナルを使用してnpm install --save @adobe/documentservices-pdftools-node-sdkコマンドを実行し、PDFサービスNode.js SDKをインストールします。