adobe / pdfservices-node-sdk-samples

Samples for the Adobe Document Services PDF Tools Node SDK
MIT License
99 stars 26 forks source link

Unable to use in Angular App #9

Closed Sudharsan-Narayanasamy closed 3 years ago

Sudharsan-Narayanasamy commented 3 years ago

I recently came across this repo and trying to implement it in an Angular application. Below are my queries in this regard.

  1. Can this npm package be used in an angular application ? Is it recommended ?
  2. I don't see a typescript definition file for this package. Is there one available ?
  3. I signed up for account access and received the required credentials. I added the required logic to generate PDF in a small angular application and when I compiled the code, I ran into below issues. Can you let me know the reason for below errors ?

    Error: ./node_modules/@adobe/documentservices-pdftools-node-sdk/node_modules/log4js/lib/clustering.js Module not found: Error: Can't resolve 'cluster' in 'C:\Projects\Stash\poc\xps\node_modules\@adobe\documentservices-pdftools-node-sdk\node_modules\log4js\lib'.

    Error: ./node_modules/@adobe/documentservices-pdftools-node-sdk/node_modules/fs-extra/lib/index.js Module not found: Error: Can't resolve 'fs' in 'C:\Projects\Stash\poc\xps\node_modules\@adobe\documentservices-pdftools-node-sdk\node_modules\fs-extra\lib'

Error: ./node_modules/@adobe/documentservices-pdftools-node-sdk/node_modules/fs-extra/lib/empty/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\Projects\Stash\poc\xps\node_modules\@adobe\documentservices-pdftools-node-sdk\node_modules\fs-extra\lib\empty'

Error: ./node_modules/@adobe/documentservices-pdftools-node-sdk/node_modules/log4js/lib/log4js.js Module not found: Error: Can't resolve 'fs' in 'C:\Projects\Stash\poc\xps\node_modules\@adobe\documentservices-pdftools-node-sdk\node_modules\log4js\lib'

Error: ./node_modules/@adobe/documentservices-pdftools-node-sdk/src/client-config.js Module not found: Error: Can't resolve 'fs' in 'C:\Projects\Stash\poc\xps\node_modules\@adobe\documentservices-pdftools-node-sdk\src'

Error: ./node_modules/@adobe/documentservices-pdftools-node-sdk/src/auth/service-account-credentials-builder.js Module not found: Error: Can't resolve 'fs' in 'C:\Projects\Stash\poc\xps\node_modules\@adobe\documentservices-pdftools-node-sdk\src\auth'

Error: ./node_modules/@adobe/documentservices-pdftools-node-sdk/src/internal/logger.js Module not found: Error: Can't resolve 'fs' in 'C:\Projects\Stash\poc\xps\node_modules\@adobe\documentservices-pdftools-node-sdk\src\internal'

Error: ./node_modules/@adobe/documentservices-pdftools-node-sdk/src/internal/api/cpf-api.js Module not found: Error: Can't resolve 'fs' in 'C:\Projects\Stash\poc\xps\node_modules\@adobe\documentservices-pdftools-node-sdk\src\internal\api'

Error: ./node_modules/@adobe/documentservices-pdftools-node-sdk/src/internal/io/file-info.js Module not found: Error: Can't resolve 'fs' in 'C:\Projects\Stash\poc\xps\node_modules\@adobe\documentservices-pdftools-node-sdk\src\internal\io'

Error: ./node_modules/@adobe/documentservices-pdftools-node-sdk/src/internal/util/validation-util.js Module not found: Error: Can't resolve 'fs' in 'C:\Projects\Stash\poc\xps\node_modules\@adobe\documentservices-pdftools-node-sdk\src\internal\util'

Error: ./node_modules/@adobe/documentservices-pdftools-node-sdk/src/internal/util/file-util.js Module not found: Error: Can't resolve 'fs' in 'C:\Projects\Stash\poc\xps\node_modules\@adobe\documentservices-pdftools-node-sdk\src\internal\util'

Error: ./node_modules/@adobe/documentservices-pdftools-node-sdk/node_modules/streamroller/lib/RollingFileWriteStream.js Module not found: Error: Can't resolve 'zlib' in 'C:\Projects\Stash\poc\xps\node_modules\@adobe\documentservices-pdftools-node-sdk\node_modules\streamroller\lib'

Error: ./node_modules/@adobe/documentservices-pdftools-node-sdk/src/internal/http/http-client.js Module not found: Error: Can't resolve 'zlib' in 'C:\Projects\Stash\poc\xps\node_modules\@adobe\documentservices-pdftools-node-sdk\src\internal\http'

Sudharsan-Narayanasamy commented 3 years ago

@KhushbooBaheti Any updates on this ?

KhushbooBaheti commented 3 years ago

Hi @Sudharsan-Narayanasamy The PDFToolsSDK for Node.js is applicable for server side Node.js applications, and Angular JS is a client side JavaScript framework.

Sudharsan-Narayanasamy commented 3 years ago

@KhushbooBaheti Thanks for the confirmation. That's what I thought.