Method FromJson
- Namespace
- LMKit.Extraction.Ocr
- Assembly
- LM-Kit.NET.dll
FromJson(string)
Deserializes the specified JSON string into an OcrResult instance.
public static OcrResult FromJson(string jsonString)
Parameters
jsonStringstringA JSON-formatted string that represents an OcrResult, including its text elements and page layout metadata.
Returns
Examples
// Restore a previously serialized OCR result
string json = File.ReadAllText("ocr_cache/page1.json");
OcrResult result = OcrResult.FromJson(json);
Console.WriteLine(result.PageText);
Exceptions
- JsonException
Thrown if the JSON is invalid or cannot be mapped to an OcrResult.