GetPDFUADiagnosticsA

PDF/UA & Accessibility

Mô tả

Ký tự A ở cuối biểu thị điểm vào DLL ANSI (char); bề mặt ActiveX/COM chỉ cung cấp dạng Unicode. Hành vi giống hệt với GetPDFUADiagnostics và các đối số chuỗi được diễn giải theo trang mã SetAnsiMode hiện tại

Trả về danh sách phân tách bằng xuống dòng gồm các vấn đề tiềm ẩn về tuân thủ PDF/UA-1 (ISO 14289-1) trong tài liệu hiện tại. Mỗi dòng chứa một mã vấn đề, theo sau là dấu hai chấm và mô tả dễ đọc. Trả về chuỗi rỗng khi không phát hiện vấn đề

Cú pháp

Delphi

Function DLGetPDFUADiagnosticsA(InstanceID: Integer): PAnsiChar;

DLL

const char * DLGetPDFUADiagnosticsA(int InstanceID);

Issue codes

PDF-VERSION-LOWPhiên bản PDF của tài liệu (như ghi trong header file) thấp hơn 1.7. PDF/UA-1 được định nghĩa dựa trên ISO 32000-1:2008 (PDF 1.7). Gọi SetPDFUAMode để tự nâng phiên bản lên 1.7
MARKED-FALSEMarkInfo/Marked không đặt là true; tài liệu không phải tagged PDF
LANG-MISSINGThe document catalog /Lang entry is absent or empty. ISO 14289-1 §7.3 requires a natural language declaration.
DISPLAYDOCTITLE-FALSEViewerPreferences/DisplayDocTitle is not true. Required by ISO 14289-1 §7.1 so the document title is shown in the title bar.
DOCINFO-TITLE-MISSINGMục /Title trong information dictionary của tài liệu vắng mặt hoặc rỗng. PDF/UA-1 yêu cầu tài liệu phải có tiêu đề để công nghệ hỗ trợ đọc ra khi tài liệu được mở. Lượt kiểm tra này bổ trợ cho DISPLAYDOCTITLE-FALSE: lượt kia xác minh tiêu đề được hiển thị trong viewer; lượt này xác minh chính giá trị tiêu đề có tồn tại. Gọi SetInformation với key Title để đặt
XMP-NO-PDFUAIDThe XMP metadata stream does not contain a pdfuaid:part entry. Required by ISO 14289-1 §7.2.
ANNOT-NO-CONTENTS:NN non-exempt annotations (excluding Widget, PrinterMark, and TrapNet subtypes) are missing a Contents entry. Required by ISO 14289-1 §7.18.1.
EMBED-NO-AFR:NN embedded files are missing an AFRelationship entry in their file specification dictionary. Required by ISO 14289-1 §7.11.
FIGURE-NO-ALT:NN Figure or Formula structure elements have no Alt text value. ISO 14289-1 §7.5 and ISO 32000-1 §14.9.3 require alternative descriptions for both graphical figures and mathematical formulas.
HEADING-LEVEL-SKIP:NN heading level jumps were detected in document order (e.g. an H1 immediately followed by an H3, skipping H2). ISO 14289-1 §7.1 and WCAG 2.x Success Criterion 1.3.1 require headings to nest without gaps.
STRUCT-UNCLOSED:NVẫn còn N structure element đang mở vì EndTag không được gọi đủ số lần. Các phần tử này sẽ bị thiếu khỏi structure tree root
TABLE-TH-NO-SCOPE:NN TH (table header cell) structure elements have no Scope attribute. ISO 32000-1 §14.8.4.3.4 Table 337 defines Scope (Row, Column, or Both) as the attribute that describes which data cells each header cell applies to. Without it, assistive technology cannot reliably associate headers with data cells in complex or multi-header tables. Call SetStructElemScope (or AddTagAttribute with Owner='Table', Name='Scope') immediately after tagging each TH element.
FORM-NO-TOOLTIP:NN interactive form fields (Widget annotations) are missing a TU (tooltip / accessible name) entry. ISO 14289-1 §7.18.4 requires all interactive form fields to carry a TU entry so assistive technology can announce the field's purpose to the user. /TU is the accessible name that screen readers read aloud; it is distinct from /T (the partial field name used programmatically). Set the TU value when creating or loading form fields.
LIST-STRUCT:NN LI or LBody structure elements appear outside their required parent. ISO 32000-1 §14.8.4.4 requires LI to be a direct child of L (list), and LBody to be a direct child of LI (list item). Malformed list nesting prevents assistive technology from navigating lists correctly. Check the BeginTag / EndTag call sequence for all list-related elements.
ROLEMAP-UNMAPPED:NN custom structure element types appear in the document but have no entry in the /RoleMap dictionary. ISO 14289-1 §7.1 and ISO 32000-1 §14.7.3 require that every non-standard structure type be mapped to a standard PDF type so assistive technology can determine how to handle the element. Call AddRoleMap for each custom type before saving. The issue description lists the unmapped type names.
SUSPECTS-TRUEMarkInfo/Suspects is set to true. ISO 14289-1 §7.1 requires files claiming PDF/UA conformance to have a Suspects value of false. A true value marks the tagging as known to contain errors. Call SetMarkInfo after the document is fully tagged to reset Suspects to false.
ROLEMAP-STANDARD-REMAP:NN standard structure types appear as the "custom" key in /RoleMap and would be remapped on save. ISO 14289-1 §7.1 forbids remapping standard tags defined in ISO 32000-1 §14.8.4 (P, H1..H6, Figure, Table, etc.). The detail line lists the offending standard tag names. Remove the affected AddRoleMap calls.
DC-TITLE-MISSINGThe XMP metadata stream's Dublin Core dc:title is missing or empty. ISO 14289-1 §7.1 requires the Metadata stream to contain a dc:title entry that clearly identifies the document. This check is separate from DOCINFO-TITLE-MISSING, which only inspects the /Info /Title entry. Call SetPDFUAMode to copy the /Info title into the XMP packet.
TRAPNET-ANNOT:NN TrapNet annotations were found on document pages. ISO 14289-1 §7.18.2 explicitly forbids TrapNet in PDF/UA-1 conforming files. Remove the offending annotations before saving.
ANNOT-PAGE-NO-TABS-S:NN pages carry one or more annotations but their page dictionary does not set /Tabs /S. ISO 14289-1 §7.18.3 requires tab order on such pages to follow the structure tree, signalled by /Tabs /S. Set /Tabs /S in the page dictionary for every page that contains annotations.
ENCRYPT-NO-ACCESSTài liệu bị mã hóa và PDFUAMode đang hoạt động, nhưng bit 10 của khóa quyền /P mã hóa (mask $200, trích xuất trợ năng) đang tắt. ISO 14289-1 §7.16 yêu cầu mọi file tuân thủ bị mã hóa phải cho phép trích xuất trợ năng. Khi PDFUAMode được đặt trước khi gọi Encrypt, bit này bị ép bật tự động. Nếu thứ tự gọi ngược lại, dictionary mã hóa đã dựng xong với giá trị /P cũ — hãy gọi Encrypt lại để dictionary được phát ra lần nữa
FIRST-HEADING-NOT-H1Phần tử tiêu đề đầu tiên theo thứ tự tài liệu không phải H1 (H sentinel của cấu trúc strong cũng tính là cấp 1). ISO 14289-1 §7.4.2 yêu cầu thẻ tiêu đề đầu tiên trong tài liệu không dùng cấu trúc strong phải là H1. Dòng chi tiết sẽ nêu cấp bị lỗi
WIDGET-NO-STRUCTPARENT:NCó N chú thích Widget thiếu mục /StructParent. ISO 14289-1 §7.18.4 yêu cầu chú thích Widget được lồng trong một tag cấu trúc Form; thiếu /StructParent thì Widget không thể chạm tới từ structure tree. Dòng chi tiết báo số đếm. Đây là kiểm tra một phần — việc xác minh đầy đủ rằng cha đã phân giải có /SForm chưa được cài
LIST-NO-NUMBERING:NCó N structure element L (danh sách) thiếu attribute ListNumbering. ISO 14289-1 §7.6 yêu cầu mọi tag L khai báo kiểu đánh số qua attribute này (các giá trị hợp lệ theo ISO 32000-1 Table 347 là None, Disc, Circle, Square, Decimal, UpperRoman, LowerRoman, UpperAlpha, LowerAlpha). Gọi SetStructElemListNumbering sau khi mở từng tag L
MULTIPLE-H-CHILDREN:NN structure tree nodes contain more than one direct H (generic heading) child. ISO 14289-1 §7.4.4 forbids that — split the parent section or replace the H tags with numbered H1..H6 sequences.

Return value

Chuỗi mô tả vấn đề phân tách bằng xuống dòng, hoặc chuỗi rỗng khi không phát hiện vấn đề tuân thủ nào

Remarks

Hàm này dành làm công cụ chẩn đoán cho lập trình viên. Nó kiểm tra trạng thái hiện tại của tài liệu trong memory và báo các vấn đề có thể khiến validation PDF/UA-1 thất bại. Gọi sau khi nạp hoặc dựng tài liệu để phát hiện vấn đề trước khi lưu

Khi SetPDFUAMode đang hoạt động và tài liệu được lưu, một số vấn đề (ANNOT-NO-CONTENTS, EMBED-NO-AFR) được tự sửa trong lúc lưu. GetPDFUADiagnostics báo trạng thái trước khi lưu; các vấn đề sẽ được tự sửa khi lưu vẫn được liệt kê nếu chúng còn hiện diện trước khi lưu

Hàm này không sửa đổi tài liệu

Ví dụ

var
  Diag: WideString;
begin
  PDFlib.SetPDFUAMode('en-US');
  // ... build document
  Diag := PDFlib.GetPDFUADiagnostics;
  if Diag <> '' then
    ShowMessage('PDF/UA issues found:'#10 + Diag);
end;

Xem thêm

SetPDFUAMode, SetDocumentLanguage, SetEmbeddedFileAFRelationship