SetPDFUAMode
Document properties, Accessibility
Mô tả
Activates PDF/UA-1 (ISO 14289-1:2014) conformance mode for the selected document. This single call performs all document-level setup required by the standard: the document version is bumped to at least PDF 1.7, MarkInfo.Marked and MarkInfo.Suspects are written, DisplayDocTitle is enabled in ViewerPreferences, Catalog/Lang is set when a language is supplied, and the pdfuaid:part=1 XMP namespace entry is written. When the document is encrypted after SetPDFUAMode is active, CanCopyAccess (bit 10 of the encryption /P key) is automatically forced on regardless of the caller-supplied TPDFExtraPermissions mask, satisfying ISO 14289-1 §7.16. If the document was already encrypted before SetPDFUAMode was called, the existing encrypt dictionary is left unchanged — call Encrypt again after SetPDFUAMode to refresh the /P value. GetPDFUADiagnostics reports this situation as ENCRYPT-NO-ACCESS.
Gọi hàm này trước khi thêm bất kỳ nội dung nào. Dùng BeginTag/EndTag và BeginArtifact/EndArtifact để gắn tag cho nội dung tài liệu
Cú pháp
Delphi
Function TPDFlib.SetPDFUAMode(Const Language: WideString): Integer;
ActiveX
Function PDFlib::SetPDFUAMode(Language As String) As Long
DLL
int DLSetPDFUAMode(int InstanceID, const wchar_t * Language);
Tham số
| Language | Thẻ ngôn ngữ BCP 47 cho ngôn ngữ mặc định của tài liệu, vd. "en-US", "de". Truyền chuỗi rỗng để bỏ qua mục /Lang của Catalog |
|---|
Giá trị trả về
| 0 | Failed (no document is open) |
|---|---|
| 1 | PDF/UA mode activated successfully |
Remarks
Khi lưu, mọi trang đang mở tự nhận mục /Tabs /S (thứ tự tab theo cấu trúc) khi chế độ PDF/UA đang hoạt động, đáp ứng ISO 14289-1 §7.18.3. Các bản sửa lúc lưu còn tự điền tooltip widget còn thiếu (/TU) và mục /Contents chú thích, gắn /AFRelationship cho file nhúng, gỡ mọi chú thích TrapNet (bị ISO 14289-1 §7.18.2 cấm), và gắn /O = List /ListNumbering = None cho mọi structure element L thiếu attribute ListNumbering tường minh (ISO 14289-1 §7.6)
See also: SetDocumentLanguage, SetMarkInfo, SetPDFAMode.