We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert PDF with HOCR to PDF/A-3B

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

@scomag

An issue as PDFJAVA-42366 has been logged in our issue management system for further analysis on this case. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.