aspose pdf java version:24.1
参考代码:https://github.com/aspose-pdf/Aspose.PDF-for-Java/blob/master/Examples/src/main/java/com/aspose/pdf/examples/AsposePdfExamples/Images/ConvertPDFPagesToJPEGImage.java
生成的jpg图片如下:
CleanShot 2024-02-26 at 11.00.14.jpg (74.3 KB)
尝试过以下方案,输出的图片文字都不显示了:
-
字体替换策略
final SystemFontsSubstitution systemFontsSubstitution = new SystemFontsSubstitution(1);
systemFontsSubstitution.setDefaultFont(FontRepository.findFont(“Arial”));
FontRepository.getSubstitutions().add(systemFontsSubstitution); -
JpegDevice, 设置RenderingOptions
JpegDevice jpegDevice = new JpegDevice(50);
final RenderingOptions renderingOptions = new RenderingOptions();
jpegDevice.setRenderingOptions(renderingOptions);
renderingOptions.setDefaultFontName(“Arial”);