GetAPIScopeReportJSON

診斷、內容串流檢查、文件編輯

描述

傳回確定性的 JSON 報告,涵蓋 API 範圍違規、目前作用中的執行期範圍,以及選配的所選頁面內容驗證

語法

Delphi

Function TPDFlib.GetAPIScopeReportJSON(
  Options: Integer= PDF_API_SCOPE_INCLUDE_CONTENT): WideString;

ActiveX

Function PDFlib::GetAPIScopeReportJSON(Options As Long) As String

DLL

const wchar_t* DLGetAPIScopeReportJSON(int InstanceID, int Options);
const char* DLGetAPIScopeReportJSONA(int InstanceID, int Options);

參數

Options零表示回報執行期狀態與保留的違規;PDF_API_SCOPE_INCLUDE_CONTENT 會額外解析所選頁面的所有內容圖層

傳回值

JSON 含整體 valid 與 balanced 旗標、所選文件與頁面、currentScope、作用中的容器與深度欄位、總計與保留的違規計數、按序排列的執行期事件,以及 content 驗證物件每個執行期事件包含單調遞增序號、文件、頁面、API 名稱、穩定代碼、預期與實際範圍,以及診斷訊息

Content validation reports unmatched or unclosed q/Q, BT/ET, marked-content, and path sequences with token positionsReturns an empty string and sets LastErrorCode to 117 when Options contains unsupported bits備註Runtime tracking has constant-time overhead on successful transitions and retains the latest 256 violations without allocating on ordinary drawing calls

無效的被追蹤轉換會立即傳回零,並設定 q/QBT/ET

ClearAPIScopeReportOptions

備註

執行期追蹤對成功的轉換只有常數時間開銷,保留最近 256 筆違規,且一般繪圖呼叫不產生配置

無效的追蹤轉換立即傳回零並設定 LastErrorCode 117,避免路徑無聲遺失、圖形狀態下溢、標記內容閉合不符,或存在未關閉範圍時切換情境

呼叫此方法不會清除保留的違規,也不改變作用中的範圍;讀取報告後請用 ClearAPIScopeReport 清除

另請參閱

ClearAPIScopeReport, GetAPIScopeReportJSONA, TraceGraphicsStates