• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Error "Location is not defined" while extracting data from stream object of pdf

New Here ,
Apr 04, 2024 Apr 04, 2024

Copy link to clipboard

Copied

While trying to extract data from pdf, where pdf is being served from aws S3 bucket as a stream object as follow:

  const storageFileName = `${dirName}/${fileName}`;
  const objectParams = {...};
  const s3 = new S3({...});

  const streamObject = await s3.getObject(objectParams).createReadStream();

Later passing this streamObject to PDFServiceSdk.FileRef.createFromStream as input.

const input = PDFServicesSdk.FileRef.createFromStream(
   streamObject,
   PDFServicesSdk.ExtractPDF.SupportedSourceFormat.pdf
);
extractPDFOperation.setInput(input);
const result = await extractPDFOperation.execute(executionContext);

 Resulting into:

ReferenceError: location is not defined

PDF Size: 100 mb.

env: Node.js 18

 

Please help me if anyone encountered same problem and able to resolve it.

TOPICS
Create PDFs , Edit and convert PDFs , JavaScript , PDF , PDF forms

Views

76

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 05, 2024 Apr 05, 2024

Copy link to clipboard

Copied

LATEST

Since you're not using Acrobat, this is not the place for your question. Look for a forum about Node.js or the library you're using to do this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines