GetPDFUADiagnostics

PDF/UA & Accessibility

คำอธิบาย

คืนค่าลิสต์คั่นด้วยบรรทัดของประเด็นที่อาจขัด PDF/UA-1 (ISO 14289-1) ที่พบในเอกสารปัจจุบัน แต่ละบรรทัดมีรหัสประเด็นหนึ่งรหัสตามด้วยโคลอนและคำอธิบายที่คนอ่านเข้าใจ คืนค่าสตริงว่างเมื่อไม่พบประเด็น

ไวยากรณ์

Delphi

Function TPDFlib.GetPDFUADiagnostics: WideString;

ActiveX

Function PDFlib::GetPDFUADiagnostics() As String

DLL

const wchar_t * DLGetPDFUADiagnostics(int InstanceID);

Issue codes

PDF-VERSION-LOWเวอร์ชัน PDF ของเอกสาร (ตามที่บันทึกในส่วนหัวไฟล์) ต่ำกว่า 1.7 PDF/UA-1 นิยามบนพื้นฐาน ISO 32000-1:2008 (PDF 1.7) เรียก SetPDFUAMode เพื่อยกระดับเวอร์ชันเป็น 1.7 ให้อัตโนมัติ
MARKED-FALSEMarkInfo/Marked ไม่ได้ตั้งเป็น true เอกสารจึงไม่ใช่ 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-MISSINGรายการ /Title ใน document information dictionary ขาดหายหรือว่าง PDF/UA-1 กำหนดให้เอกสารต้องมีชื่อเรื่อง เพื่อให้เทคโนโลยีช่วยเหลือประกาศตอนเปิดเอกสาร การตรวจนี้เสริมกับ DISPLAYDOCTITLE-FALSE: ตัวนั้นเช็คว่าชื่อเรื่องถูกแสดงในโปรแกรมดูหรือไม่ ตัวนี้เช็คว่าค่าชื่อเรื่องมีอยู่จริงหรือไม่ ตั้งค่าได้โดยเรียก SetInformation ด้วยคีย์ Title
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:Nองค์ประกอบโครงสร้าง N รายการยังเปิดค้างอยู่เพราะไม่ได้เรียก EndTag ให้ครบจำนวนที่ถูกต้อง องค์ประกอบเหล่านี้จะหายไปจากรากทรีโครงสร้าง
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-ACCESSเอกสารถูกเข้ารหัสและ PDFUAMode เปิดอยู่ แต่บิต 10 ของคีย์สิทธิ์การเข้ารหัส /P (มาสก์ $200, สกัดเพื่อการเข้าถึง) ไม่ถูกตั้ง ISO 14289-1 §7.16 กำหนดให้ไฟล์ที่เข้ารหัสทุกไฟล์ที่สอดคล้องต้องอนุญาตการสกัดเพื่อการเข้าถึง ถ้าตั้ง PDFUAMode ก่อนเรียก Encrypt บิตนี้จะถูกบังคับเปิดให้เอง ถ้าเรียกสลับลำดับ พจนานุกรมการเข้ารหัสจะถูกวางไว้แล้วด้วยค่า /P เดิม — ให้เรียก Encrypt ซ้ำเพื่อให้พจนานุกรมถูกเขียนใหม่
FIRST-HEADING-NOT-H1องค์ประกอบหัวข้อแรกตามลำดับเอกสารไม่ใช่ H1 (sentinel H แบบ strongly-structured ก็นับเป็นระดับ 1) ISO 14289-1 §7.4.2 กำหนดให้แท็กหัวข้อแรกของเอกสารที่ไม่ใช่ strongly-structured ต้องเป็น H1 บรรทัดรายละเอียดจะระบุระดับที่ผิด
WIDGET-NO-STRUCTPARENT:Nคำอธิบายประกอบ Widget N รายการไม่มีรายการ /StructParent ISO 14289-1 §7.18.4 กำหนดให้คำอธิบายประกอบ Widget ต้องซ้อนอยู่ในแท็กโครงสร้าง Form, ถ้าไม่มี /StructParent จะไล่ถึง Widget จากทรีโครงสร้างไม่ได้เลย บรรทัดรายละเอียดรายงานจำนวน การตรวจนี้เป็นแบบย่อย — การตรวจเต็มว่า parent ที่ไล่ได้มี /S เป็น Form ยังไม่ได้ทำ
LIST-NO-NUMBERING:Nองค์ประกอบโครงสร้าง L (list) N รายการไม่มีแอตทริบิวต์ ListNumbering ISO 14289-1 §7.6 กำหนดให้แท็ก L ทุกแท็กประกาศรูปแบบการใส่เลขผ่านแอตทริบิวต์นี้ (ค่าที่ถูกต้องตาม ISO 32000-1 Table 347 คือ None, Disc, Circle, Square, Decimal, UpperRoman, LowerRoman, UpperAlpha, LowerAlpha) เรียก SetStructElemListNumbering หลังเปิดแท็ก 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

สตริงคั่นด้วยขึ้นบรรทัดใหม่ของคำอธิบายประเด็น หรือสตริงว่างถ้าไม่ตรวจพบประเด็นความสอดคล้องใด

Remarks

ฟังก์ชันนี้ทำไว้เป็นเครื่องมือวินิจฉัยสำหรับนักพัฒนา ตรวจสถานะปัจจุบันของเอกสารในหน่วยความจำแล้วรายงานประเด็นที่อาจทำให้ตรวจ PDF/UA-1 ไม่ผ่าน เรียกหลังโหลดหรือประกอบเอกสาร เพื่อจับประเด็นก่อนบันทึก

เมื่อ SetPDFUAMode เปิดอยู่และเอกสารถูกบันทึก ประเด็นบางข้อ (ANNOT-NO-CONTENTS, EMBED-NO-AFR) จะถูกแก้ให้อัตโนมัติระหว่างบันทึก GetPDFUADiagnostics รายงานสถานะก่อนบันทึก ประเด็นที่จะถูกแก้อัตโนมัติตอนบันทึกก็ยังถูกรายงานถ้ามีอยู่ก่อนบันทึก

ฟังก์ชันนี้ไม่แก้ไขเอกสาร

ตัวอย่าง

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

ดูเพิ่มเติม

SetPDFUAMode, SetDocumentLanguage, SetEmbeddedFileAFRelationship