Free Support Forum - aspose.com

Retain Chinese Text during Word DOC to PDF Conversion using Java over Red Hat OpenShift

We are using aspose-words-21.2-jdk17 (.jar).

We convert a WORD doc to PDF. However, we found in Red Hat Openshift environment. Some chinese words are missing/blank in the PDF.

WORD:
image.png (1.5 KB)

PDF:
image.png (10.4 KB)

Note, not all Chinese words are blank.

Any recommendation?

Code snippet:

@Service
class PdfConverter {

    private val log = LoggerFactory.getLogger(PdfConverter::class.java)

    private val pdfSaveOptions = PdfSaveOptions().apply {
        fontEmbeddingMode = EMBED_ALL
        compliance = PDF_A_1_B
    }

    fun convert(wordDocument: Document): Document {
        val outputStream = ByteOutputStream()
        val executionTime = measureTimeMillis {
            val document = com.aspose.words.Document(wordDocument.contentStream())
            document.save(outputStream, pdfSaveOptions)
        }

        log.info("PDF conversion completed in ${executionTime / 1000.0} seconds")
        return Document(PDF, outputStream.bytes)
    }
}

@kslau,

Please try the latest (21.3) version of Aspose.Words for Java and see how it goes on your end? In case the problem still remains, then please ZIP and upload your input Word document and Aspose.Words generated PDF file showing the undesired behavior here for testing. We will then investigate the issue on our end and provide you more information.

Hi

I have upgraded to use latest 21.3 version on our red hat OpenShift environment.

The problem is still remains – some Chinese characters are missing.

Let me know if you have any recommendation.

Regards

Sun

LA_SLD_Index_Chinese.zip (4.53 MB)

@kslau,

We have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-22111. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.