{"record":{"id":"85e099e1b86c68d7","repo":"opendataloader-project/opendataloader-pdf","slug":"pdf2img-page-png-data-is-empty","errorCode":null,"errorMessage":"pdf2img PAGE_PNG_DATA is empty","messagePattern":"pdf2img PAGE_PNG_DATA is empty","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/hybrid/HancomAIClient.java","lineNumber":712,"sourceCode":"            }\n\n            JsonNode root = objectMapper.readTree(respBody.string());\n            // Navigate: RESULT[0].RESULT.PAGE_PNG_DATA\n            JsonNode resultArr = root.get(\"RESULT\");\n            if (resultArr == null || !resultArr.isArray() || resultArr.size() == 0) {\n                throw new IOException(\"pdf2img RESULT is empty\");\n            }\n\n            JsonNode pageResult = resultArr.get(0);\n            JsonNode innerResult = pageResult.get(\"RESULT\");\n            if (innerResult == null) {\n                throw new IOException(\"pdf2img inner RESULT is null\");\n            }\n\n            String pngBase64 = innerResult.has(\"PAGE_PNG_DATA\")\n                ? innerResult.get(\"PAGE_PNG_DATA\").asText() : null;\n            if (pngBase64 == null || pngBase64.isEmpty()) {\n                throw new IOException(\"pdf2img PAGE_PNG_DATA is empty\");\n            }\n\n            byte[] pngBytes;\n            try {\n                pngBytes = Base64.getDecoder().decode(pngBase64);\n            } catch (IllegalArgumentException e) {\n                // fetchPageImage is declared to throw IOException and callers catch\n                // only IOException. Escaping IAE would abort the whole conversion\n                // instead of skipping the failed page.\n                throw new IOException(\"pdf2img PAGE_PNG_DATA is not valid Base64\", e);\n            }\n            BufferedImage image = ImageIO.read(new ByteArrayInputStream(pngBytes));\n            if (image == null) {\n                throw new IOException(\"pdf2img PAGE_PNG_DATA is not a readable image\");\n            }\n            if (cropOutput.active()) {\n                savePageImageFile(cropOutput.directory(), pageIndex, pngBytes);\n            }","sourceCodeStart":694,"sourceCodeEnd":730,"githubUrl":"https://github.com/opendataloader-project/opendataloader-pdf/blob/a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8/java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/hybrid/HancomAIClient.java#L694-L730","documentation":"The nested RESULT object exists but PAGE_PNG_DATA is missing or an empty string, so there is no image payload to decode. fetchPageImage checks this before attempting Base64 decode. Per-page IOException, caught and logged by table/figure handlers.","triggerScenarios":"innerResult.has(\"PAGE_PNG_DATA\") is false, or innerResult.get(\"PAGE_PNG_DATA\").asText() is null or empty, inside fetchPageImage.","commonSituations":"Backend rendered the page but failed to encode/attach the PNG (disk full, encoder error); backend returned a placeholder entry without image data; backend version returning a renamed field.","solutions":["Check backend pdf2img logs for PNG encoding/storage errors on the page","Confirm the field name PAGE_PNG_DATA matches this backend version","Retry the page; if persistent, accept the per-page skip","Ensure the backend has disk/memory for page image encoding"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    return cache.getOrFetch(pageNum, idx -> client.fetchPageImage(pdf, idx, crop));\n} catch (IOException e) {\n    if (e.getMessage().contains(\"PAGE_PNG_DATA is empty\")) {\n        log.warn(\"page {} rendered but PNG payload missing\", pageNum);\n    }\n    continue;\n}","preventionTips":["Ensure the backend has disk/memory to encode page PNGs","Confirm the PAGE_PNG_DATA field name matches this backend version","Accept per-page skips for degraded output"],"tags":["hybrid","hancom-ai","pdf2img","response-parsing"],"backgroundTag":null,"analyzedSha":"a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8","analyzedAt":"2026-08-14T05:22:03.953Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}