IronSecureDoc ハウツー パスワードと権限 How to Encrypt/Add Password & Permissions to PDF Files Curtis Chau 更新日:7月 22, 2025 Download IronSecureDoc 無料ダウンロード Start Free Trial Copy for LLMs Copy for LLMs Copy page as Markdown for LLMs Open in ChatGPT Ask ChatGPT about this page Open in Gemini Ask Gemini about this page Open in Grok Ask Grok about this page Open in Perplexity Ask Perplexity about this page Share Share on Facebook Share on X (Twitter) Share on LinkedIn Copy URL Email article This article was translated from English: Does it need improvement? Translated View the article in English Securing PDF files with passwords and specific permissions is vital for protecting sensitive documents from unauthorized access and manipulation. The [POST] Encrypt/Add Password & Permissions API from IronSecure Doc provides an efficient way to encrypt PDF files with user and owner passwords while configuring permissions for printing, form filling, annotations, and more. This API ensures that the PDF is fully protected and access is controlled, making it ideal for legal, financial, or personal documents. How to Encrypt/Add Password & Permissions to PDF Files Pull and start the IronSecureDoc Docker Image Test the API using Swagger Specify the parameters for password and permissions Execute the API call to apply the changes Export the encrypted PDF document Pull and Start IronSecureDoc If you don't have IronSecureDoc running yet, please follow the links below to get it set up: Host Locally Deploy to Cloud Hosting on Windows Hosting on Mac Hosting on Linux Deploy on Azure Container Deploy on AWS Container The [POST] Encrypt/Add Password & Permissions API The [POST] Encrypt/Add Password & Permissions API allows you to add security layers to PDF documents by encrypting them with passwords and setting specific permissions for various operations. Whether it's granting read access, allowing form filling, or disabling printing, this API gives you control over how your PDF files are accessed and modified. Swagger Swagger offers a user-friendly interface to test this API interactively. You can use it to send test requests and receive responses without writing code, making it a great tool for developers. Steps to Redact Text with Swagger Access the Swagger UI: If your API server is running locally, you can access Swagger by navigating to http://localhost:8080/swagger/index.html in your web browser. Locate the API: Find the [POST] /v1/document-services/pdfs/encrypt API, which corresponds to Encrypt/Add Password & Permissions. Input Parameters: Provide the required parameters for the API. You can upload a sample PDF file and specify the desired permissions. Upload PDF File: In the request body, upload a PDF file as pdf_file and define the necessary permissions, such as allowing or restricting printing, form filling, and content extraction. Execute the Request: Once all parameters are set, click "Execute" to send the request. The response will return the encrypted PDF with the specified security settings. Check the Output PDF: Type in 'password' to view the PDF content. This browser does not support PDFs. Please download the PDF to view it: Download PDF. Understanding Input Parameters The API requires specific parameters to encrypt the PDF and assign permissions. Below is a breakdown of both required and optional parameters: Required Parameters Name Data Type Description pdf_file application/pdf The PDF file you want to encrypt. allow_extracting_content boolean Indicate whether content extraction is allowed. allow_form_filling boolean Indicate whether form filling is allowed. allow_annotations boolean Indicate whether annotations are allowed. allow_printing boolean Indicate whether printing is allowed. allow_modifications boolean Indicate whether modifications are allowed. new_owner_password string The new owner password for the PDF, which grants full access and the ability to change permissions. Optional Parameters Name Data Type Description user_password string The current user password, required if the PDF has a user password to grant read access. owner_password string The current owner password, required if the PDF has an owner password to grant full access. new_user_password string The new user password for read access. save_as_pdfa boolean Save the PDF as PDF/A-3 compliant. save_as_pdfua boolean Save the PDF as PDF/UA compliant. author string Set the PDF metadata Author property. title string Set the PDF metadata Title property. subject string Set the PDF metadata Subject property. API Integration: Python Example Once you're familiar with the input parameters, you can call the API using Python or any other preferred language. Below is an example of how to integrate this API using Python. import requests # Endpoint URL url = 'http://localhost:8080/v1/document-services/pdfs/encrypt' # Headers with metadata information headers = { 'accept': '*/*', 'author': 'IronSoftware', 'title': 'ENCRYPTION DEMO 2024', 'subject': 'DEMO EXAMPLE' } # Files to be sent in the request files = { 'pdf_file': ('sample.pdf', open('sample.pdf', 'rb'), 'application/pdf') } # Parameters for encryption and permissions data = { 'allow_extracting_content': 'true', 'allow_form_filling': 'true', 'allow_annotations': 'false', 'allow_printing': 'false', 'allow_modifications': 'true', 'new_owner_password': 'password', 'new_user_password': 'password', 'save_as_pdfa': 'false', 'save_as_pdfua': 'false' } # Send POST request with parameters response = requests.post(url, headers=headers, files=files, data=data) # Save the encrypted PDF to file system with open('sample_encrypted.pdf', 'wb') as f: f.write(response.content) print('PDF encrypted successfully.') import requests # Endpoint URL url = 'http://localhost:8080/v1/document-services/pdfs/encrypt' # Headers with metadata information headers = { 'accept': '*/*', 'author': 'IronSoftware', 'title': 'ENCRYPTION DEMO 2024', 'subject': 'DEMO EXAMPLE' } # Files to be sent in the request files = { 'pdf_file': ('sample.pdf', open('sample.pdf', 'rb'), 'application/pdf') } # Parameters for encryption and permissions data = { 'allow_extracting_content': 'true', 'allow_form_filling': 'true', 'allow_annotations': 'false', 'allow_printing': 'false', 'allow_modifications': 'true', 'new_owner_password': 'password', 'new_user_password': 'password', 'save_as_pdfa': 'false', 'save_as_pdfua': 'false' } # Send POST request with parameters response = requests.post(url, headers=headers, files=files, data=data) # Save the encrypted PDF to file system with open('sample_encrypted.pdf', 'wb') as f: f.write(response.content) print('PDF encrypted successfully.') PYTHON Steps Explained: Load the PDF: The PDF file to be encrypted is loaded from the local file system. Set Encryption Parameters: Define permissions like allowing printing, form filling, and content extraction, as well as setting new passwords. Call the API: The [POST] Encrypt/Add Password & Permissions API is called, passing the necessary parameters. Save the Result: The encrypted PDF is saved as a new file. The PDF file is encrypted as shown below. Type in 'password' to view the PDF content. This browser does not support PDFs. Please download the PDF to view it: Download PDF. よくある質問 機密情報を保護するためにPDFファイルを暗号化するにはどうすればよいですか? PDFファイルを暗号化するには、IronSecureDoc APIを使用して、ユーザーパスワードとオーナーパスワードの両方を設定できます。これらのパスワードは、印刷やフォーム入力などのアクセスと権限を制御するのに役立ち、ドキュメントのセキュリティを確保します。 IronSecureDoc APIを使用したPDF暗号化にはどのような手順が含まれていますか? まず、IronSecureDoc Dockerイメージを取得し、ホスティング環境に応じてセットアップします。次に、APIを使用して暗号化のパラメータを指定し(パスワードや権限の設定など)、APIコールを実行して保護されたPDFを生成します。 コードを書かずにIronSecureDoc APIをテストするにはどうすればよいですか? Swaggerを使用してIronSecureDoc APIをテストできます。Swagger UIにアクセスし、関連するAPIエンドポイントを見つけ、必要なパラメータを入力してリクエストを実行し、レスポンスを確認してAPIが正しく機能していることを確認してください。 PDFセキュリティにおけるユーザーパスワードとオーナーパスワードとは何ですか? PDFセキュリティでは、ユーザーパスワードはドキュメントの読み取りを許可し、オーナーパスワードは権限の変更を含む完全なアクセスを許可します。IronSecureDocを使用すると、両方の種類のパスワードを設定してドキュメントのセキュリティを強化できます。 IronSecureDocを使ってPDFをPDF/A準拠に設定することはできますか? はい、IronSecureDoc APIには、暗号化されたPDFを長期保存のための電子文書の標準であるPDF/A-3準拠として保存するためのパラメータが含まれています。 IronSecureDoc APIで制御できる権限には何がありますか? IronSecureDoc APIを使用すると、印刷、フォーム入力、コンテンツ抽出、注釈、変更などの権限を制御でき、PDFがセキュリティポリシーに一致した形式で使用されるようにします。 IronSecureDoc APIをPythonアプリケーションと統合するにはどうすればよいですか? PythonとIronSecureDoc APIを統合するには、requestsライブラリを利用してAPIエンドポイントにPOSTリクエストを送信します。必要なヘッダー、パラメータ、ファイルデータをリクエストに含めてPDFファイルを暗号化し管理します。 IronSecureDocを使用してPDFを暗号化するために必要なパラメータは何ですか? 必要なパラメータには、暗号化するPDFファイル、ユーザーとオーナーのパスワード、および印刷や編集などのアクションに対する権限が含まれます。これらのパラメータは、ドキュメントのセキュリティと使用の管理を保証します。 IronSecureDocを使用した暗号化中にPDFのメタデータを変更することは可能ですか? はい、著者、タイトル、主題などのPDFメタデータは、IronSecureDoc APIのオプションパラメータを使って変更でき、暗号化プロセス中にドキュメント情報をカスタマイズすることが可能です。 IronSecureDocをローカルに実行するためのホスティング要件は何ですか? IronSecureDocは、Windows、Mac、またはLinuxシステムでローカルにホスティングできます。サービスの正しいインストールと運用を確保するために、オペレーティングシステムに特化したセットアップチュートリアルに従ってください。 Curtis Chau 今すぐエンジニアリングチームとチャット テクニカルライター Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。 準備はいいですか? バージョン: 2024.10 ただ今リリースされました 無料ダウンロード ライセンスを見る