Hi,
We are trying to convert a PDF with custom HOCR information to PDF/A-3B.
When searching in the result PDF, the positioning of the cursor is wrong.
Our code:
public void convert(InputStream inputPdf, OutputStream outputPdf, Optional<String> hocr) {
Document pdfDoc = new Document(inputPdf);
if(hocr.isPresent()){
pdfDoc.convert(bufferedImage -> hocr.get());
}
//pdfDoc.validate(new PdfFormatConversionOptions(PdfFormat.PDF_A_3B));
PdfFormatConversionOptions pdfConvertOptions = new PdfFormatConversionOptions(PdfFormat.PDF_A_3B);
pdfDoc.convert(pdfConvertOptions);
pdfDoc.save(outputPdf);
}
Example:
Input PDF:
Custom-Input.pdf (353.2 KB)
Input HOCR (zipped):
Custom-Input.hocr.7z (5.0 KB)
Result PDF:
Custom-Result.pdf (443.0 KB)
Thanks
Didi