PDF BAD PASSWORD Exception

This article was translated from English: Does it need improvement?
Translated
View the article in English

The "ERROR-003" error occurs when the user_password and/or owner_password parameter in the POST request is incorrect.

  • Check both USER and OWNER passwords.
    The User Password is the password that you enter to view a PDF file, and the Owner Password is the one that allows you to change the PDF file. In some cases, they might be the same password, but properly secured PDFs should have different values.

Example of Proper Password Application in cURL

The following curl command demonstrates how to make a POST request to redact text from a PDF with user and owner passwords provided.

curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/redact-text' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'words_to_redact="IRON"' \
  -F 'user_password="1234"' \
  -F 'owner_password="5678"' \
  -F 'pdf_file=@YOUR_PDF_DOCUMENT.pdf;type=application/pdf'
curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/redact-text' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'words_to_redact="IRON"' \
  -F 'user_password="1234"' \
  -F 'owner_password="5678"' \
  -F 'pdf_file=@YOUR_PDF_DOCUMENT.pdf;type=application/pdf'
SHELL
  • -F 'words_to_redact="IRON"' specifies the words in the PDF to redact.
  • -F 'user_password="1234"' provides the password to view the PDF.
  • -F 'owner_password="5678"' provides the password that allows modifications to the PDF.
  • -F 'pdf_file=@YOUR_PDF_DOCUMENT.pdf;type=application/pdf' is how you attach the PDF document to the request.

提示Ensure that the passwords provided match those set in your PDF file. Incorrect passwords will result in an "ERROR-003" response.

Curtis Chau
技术作家

Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。

除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。

准备开始了吗?
版本: 2024.10 刚刚发布