IRONSOFTWAREHOME
パスワード、セキュリティ、およびメタデータ

import com.ironsoftware.ironpdf.PdfDocument;
import com.ironsoftware.ironpdf.security.PdfPrintSecurity;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.Date;

// Open an encrypted file (or create a new one from HTML)
PdfDocument pdf = PdfDocument.fromFile(Paths.get("assets/encrypted.pdf"), "password");

// Edit file metadata
MetadataManager metadata = pdf.getMetadata();
metadata.setAuthor("Satoshi Nakamoto");
metadata.setKeywords("SEO, Friendly");
metadata.setModifiedDate(new Date().toString());

// Edit file security settings
// The code below makes the PDF read only and disallows users to copy, paste, and print
SecurityOptions securityOptions = new SecurityOptions();
securityOptions.setAllowUserCopyPasteContent(false);
securityOptions.setAllowUserAnnotations(false);
securityOptions.setAllowUserPrinting(PdfPrintSecurity.FULL_PRINT_RIGHTS);
securityOptions.setAllowUserFormData(false);
securityOptions.setOwnerPassword("top-secret");
securityOptions.setUserPassword("sharable");

// Change or set the document encryption password
SecurityManager securityManager = pdf.getSecurity();
securityManager.removePasswordsAndEncryption();
securityManager.makePdfDocumentReadOnly("secret-key");


securityManager.setSecurityOptions(securityOptions);
pdf.saveAs(Paths.get("assets/secured.pdf"));
mvn install
パスワード、セキュリティ、およびメタデータ

パスワード、セキュリティ、およびメタデータ

IronPDFは、PDFのメタデータおよびセキュリティ設定を変更することができます。 セキュリティに関しては、PDFを読み取り専用、印刷不可、パスワード保護、暗号化できる機能が含まれます。 メタデータについては、新しいプロパティを定義し、既存のプロパティを編集する機能が含まれます。

IronPDF for Java の PDF のメタデータを管理するには、開発者はまずその MetadataManager への参照を取得する必要があります。 このクラスはPDFのメタコンテンツへの直接アクセスと修正のためのメソッドを提供します。 開発者は、PDFドキュメントで定義された一般的なメタプロパティを、同じ名前のゲッターとセッターを使用して迅速に読み取りおよび編集できます。

便利なゲッターとセッターを備えたプロパティの完全なリストは以下の通りです:

  • Producer
  • CreationDate
  • Creator
  • Author
  • Keywords
  • Subject
  • Title
  • ModifiedDate

このコード例では、setKeywords、および setModifiedDate メソッドを使用して、作業文書の著者、タイトル、およびキーワードを変更します。

以前に列挙したもの以外のプロパティを取得および設定するには、目的のプロパティの名前と共に getAnyMetadata および setAnyMetadata メソッドを使用してください。

同様に、PDF ドキュメントのセキュリティ設定にアクセスして変更するには SecurityManager を介して行う必要があります。 指定の用途に必要なように PDF へのアクセスを制限するため、getSecurity を PdfDocument で呼び出して、その SecurityManager への参照を取得し、それを使用してください。

Java 開発者は、PDF のセキュリティ設定をより詳細に制御するために SecurityOptions オブジェクトを使用できます。

JavaのPDF管理のためのMetadataManager APIを探る
GitHubで見る

準備はできましたか?

バージョン:2026.6リリースされたばかり

Key in blue circle

無料の30日間トライアルキーをすぐに入手してください。

Your trial license will be sent to your email address

制限なし。100% ロック解除済み。クレジットカード不要。

OR
bullet_checkedクレジットカードやアカウントの作成は不要です。制限なし。100% ロック解除済み。クレジットカード不要。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried Iron Suite
無料のライブデモを予約する
Booking Badge

世界中の数百万人のエンジニアから信頼されています。

ライセンスはより安く
義務のない相談を受ける
下記のフォームを記入するか、sales@ironsoftware.comにメールしてください。
あなたの詳細は常に守秘されます。
世界中の数百万人のエンジニアから信頼されています。
ライセンスはより安く
あなたの無料30日間の試用キーをすぐに入手。
クレジットカードやアカウントの作成は不要です。
PDFのため for Java Mavenライブラリ
Mavenでインストール

バージョン: 2026.6

<dependency>
   <groupId>com.ironsoftware</groupId>
   <artifactId>ironpdf</artifactId>
   <version>2026.6.1</version>
</dependency>
https://central.sonatype.com/artifact/com.ironsoftware/ironpdf/2026.6.1
or
Java PDF JAR
JAR をダウンロード

バージョン: 2026.6

Manually install into your project