Japanese character seems not clearly visible in pdf

Hi Team,

The character seems not clearly visible in pdf. when the pdf is open in chrome Browers. I am attaching file in which docx is converted into pdf using the aspose. Also, I have attached the fonts which we are using for the conversion to pdf.

Please find the code snippet for the reference.

com.aspose.words.Document document = new com.aspose.words.Document(inputFile.getAbsolutePath());
document.setWarningCallback(new Warning());
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.setTextCompression(PdfTextCompression.FLATE);
pdfSaveOptions.setUseHighQualityRendering(false);
pdfSaveOptions.setMemoryOptimization(true);
pdfSaveOptions.setDisplayDocTitle(true);
document.save(exportedFileLocation, pdfSaveOptions);

if (document.getCustomDocumentProperties().contains("RightsWATCHMark"))
{
    String rightsWatchMark = document.getCustomDocumentProperties().get("RightsWATCHMark").toString();
    String encodedRightsWatchMark = Base64.getEncoder().encodeToString(rightsWatchMark.getBytes());
    com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(exportedFileLocation);
    DocumentInfo documentProperty = pdfDocument.getInfo();
    documentProperty.set_Item("RightsWATCHMark", encodedRightsWatchMark);
    pdfDocument.save();
    pdfDocument.close();
    pdfDocument.dispose();
}

We are using aspose-word-23.7-jdk-17.jar and aspose-pdf-23.5-jdk17.jar.

Regards
sample.zip (1.3 MB)

@forasposeissues The following fonts used in your document are not available on my side:

  • ‘Citi Sans Text’
  • ‘Citi Serif Display’
  • ‘Citi Sans Condensed’
  • ‘MS Shell Dlg 2’
  • ‘Citi Sans Text’

Could you please attach these fonts here for testing?

Please note, to build an accurate document layout the fonts are required. If Aspose.Words cannot find the fonts used in the document the fonts are substituted. This might lead into the layout differences due to differences in fonts metrics. You can implement IWarningCallback to get a notification when font substitution is performed.
Please see our documentation to learn where Aspose.Words looks for fonts:
https://docs.aspose.com/words/java/specify-truetype-fonts-location/

Hi Team,

Please find the font as mentioned. But, MS Shell Dlg 2’ is not available with us.

font.zip (5.4 MB)

@forasposeissues Thank you for additional information. It looks like a problem in the Google Chrome PDF viewer. I have tested with PDF produced using MS Word and see exactly the same result:

ms.pdf (1.2 MB)

Though both PDF documents (produced by Aspose.Words and MS Word) look fine if open in Acrobat Reader.

Hi Team,

Thanks for quick response. Could we fix the issue when the pdf is opened in google chrome.

Regards,

@forasposeissues There are no problems with PDF itself. PDF document has the fonts embedded into the file. The consumer application uses these fonts to render the document. It looks like Google Chrome PDF viewer renders bold MS PGothic font not the same way as Acrobat Reader or MS Word does. I am afraid, I do not see any way to fix this on our side. The problem should be considered on Google Chrome PDF viewer side.

Hi Team,

Can we work to enhance resolution of character more when pdf generated from word? It might help when pdf is open in google chrome.

Regards,

@forasposeissues Text in PDF document is not raster so there is no way to “enhance resolution” of text. Glyphs are drawn by the consumer application using the fonts from the PDF document. Font defines glyphs in vector form.