Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

userPassoword not working #34

Open
muhammad707 opened this issue Jan 13, 2022 · 0 comments
Open

userPassoword not working #34

muhammad707 opened this issue Jan 13, 2022 · 0 comments

Comments

@muhammad707
Copy link

muhammad707 commented Jan 13, 2022

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)`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant