Skip to main content
Interwork Corporation
IDR Solutions Product Support Portal
PDF開発用語集 モードの切替 ダーク/ライト/自動 モードの切替 ダーク/ライト/自動 モードの切替 ダーク/ライト/自動

Arlington PDFモデルを使用したPDFファイルの検証

v2026.08

JPedalは、Arlington PDFモデル向けのパーサーおよびバリデーターを提供しています。

バリデーターの使用方法

Arlington PDFモデルのTSV形式のファイルが必要です。PDF AssociationのGitHubリポジトリ(https://github.com/pdf-association/arlington-pdf-model )から入手できます。リポジトリをクローン/ダウンロードし、tsv/latest ディレクトリの場所を確認してください。

コマンドライン

コマンドラインアプリケーションを使用すると、1つ以上のファイルをモデルに対して検証できます。レベルフィルターを指定することで、特定の深刻度以上の検証問題のみを表示することも可能です。

java org.jpedal.arlington.validate.PdfArlingtonValidator --tsv <path-to-arlington-tsv-dir> [--level LEVEL] file1.pdf [file2.pdf ...]

すべての問題は次の形式で出力されます: [level] path-in-pdf (arlington-object-definition): issue-message

出力例:

[ERROR] Trailer/Root/Pages/Kids[0]/Resources/Font/F1/Encoding/Type (Encoding): Value of 'Type' (/Font) is not one of the permitted values [Encoding]
[ERROR] Trailer/Root/Pages/Kids[0]/Resources/Font/F1/Widths (FontType3): SpecialCase constraint violated: fn:Eval((fn:ArrayLength(Widths) == (1.0 + (@LastChar - @FirstChar))))
[ERROR] Trailer/Root/Pages/Kids[0]/Resources/Font/F2/FontDescriptor (FontCIDType0): Value must be an indirect reference (fn:MustBeIndirect) but is a direct object
[ERROR] Trailer/Root/Pages/Kids[0]/Resources/Font/F2/FontDescriptor/Style/Panose (StyleDict): SpecialCase constraint violated: fn:Eval((fn:StringLength(Panose) == 12.0))
[ERROR] Trailer/Root/Pages/Kids[0]/Resources/Font/F2/FontDescriptor/Descent (FontDescriptorCIDType0): Value of 'Descent' (123) is not one of the permitted values [fn:Eval((@Descent <= 0.0))]
[ERROR] Trailer/Root/PageLayout (Catalog): Value of 'PageLayout' (/AnUndefinedOption) is not one of the permitted values [SinglePage, OneColumn, TwoColumnLeft, TwoColumnRight, TwoPageLeft, TwoPageRight]
[INFO] Trailer/Root/CatalogCustomKey (Catalog): Key 'CatalogCustomKey' is not defined by the Arlington model for Catalog and no wildcard entry is present
[ERROR] Trailer/Root/MarkInfo/Suspects (MarkInfo): Value has type integer but the model expects one of boolean for key/index 'Suspects'
[ERROR] Trailer/Root/Lang (Catalog): Value has type name but the model expects one of string-text for key/index 'Lang'
[WARNING] Trailer/Root/OpenAction/URI (ActionURI): Value of 'URI' ((\003\006Bad ASCII)) contains unprintable ASCII characters

Java

Javaのメソッドを使用すると、1つ以上のファイルをモデルに対して検証できます。また、パスワードで保護された/暗号化されたファイルを読み込むことも可能です。

// Load model
final Map<String, ArlingtonObject> model = ArlingtonModelLoader.load(Path.of("tsv/latest"));
// Load file
final PdfArlingtonValidator.Result result = validateFile(new File("inputFile.pdf"), model);
// Load file with password
final PdfArlingtonValidator.Result result = validateFile(new File("inputFile.pdf"), "password".getBytes(), model);

検出された問題はリストとして返され、順に参照・確認することができます。

出力例:

for (final ValidationIssue issue : result.issues) {
    // Iterate over issues
}