Skip to content

userPassoword not working #34

@muhammad707

Description

@muhammad707

I have some pdf files that has passwords. I am using this library and passing password as a 'userPassword' but anyway authentication is failing.

      extract( filePath, pdftotextOptions, function( error, pages ) {
      var fullText;
      if ( error ) {
        error = new Error( 'Error extracting PDF text for file at [[ ' +
          path.basename( filePath ) + ' ]], error: ' + error.message );
        cb( error, null );
        return;
      }
      fullText = pages.join( ' ' ).trim();
      cb( null, fullText );
    });

pdftotextOptions = { 'userPassword': <some_password> }. I tried with ownerPassword too.
What I am getting is
`Error: Error extracting PDF text for file at [[ pdf-example-password.original.pdf ]], error: pdf-text-extract command failed: Command Line Error: Incorrect password

at C:\Users\Mukhammadjon_Sirojid\Desktop\Schlumberger\mySLM-textract\lib\extractors\pdf.js:20:15
at splitPages (C:\Users\Mukhammadjon_Sirojid\Desktop\Schlumberger\mySLM-textract\node_modules\pdf-text-extract\index.js:80:14)
at ChildProcess.closeHandler (C:\Users\Mukhammadjon_Sirojid\Desktop\Schlumberger\mySLM-textract\node_modules\pdf-text-extract\index.js:135:14)
at ChildProcess.emit (events.js:314:20)
at maybeClose (internal/child_process.js:1022:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions