Getting total page count from pdf created with interactive communication
Hello,
I am generating pdf with bathc API . I need to get also total page number created pdf.
BatchInput batchInput = batchBuilderFactory.getBatchInputBuilder().setData(inputJSONArray).setTemplatePath(templatePath).build();
BatchConfig batchConfig = batchBuilderFactory.getBatchConfigBuilder().setBatchType(BatchType.PRINT).build();
BatchResult batchResult = batchGeneratorService.generateBatch(batchInput, batchConfig);
RecordResult recordResult = checkOneElement(batchResult.getRecordResults(), "generated record");
RenditionResult renditionResult = checkOneElement(recordResult.getRenditionResults(), "generated result");
I tried to get PAGE_COUNT of Document object but is null, i also checked if rendition result has some meta data but it is null also.
Document doc = renditionResult.getDocumentStream();
log.info("doc PAGE_COUNT [{}]", doc.getAttribute("PAGE_COUNT"));
if (renditionResult.getMetadata() != null) {
for (Entry<String, Object> e : renditionResult.getMetadata().entrySet()) {
log.info("Entry {} : {}", e.getKey(), e.getValue());
}
}
Is there any meta data or api for getting total number of page for pdf please?