生成的图片,字体加粗就会生成 小格子,望知道的大侠指点指点
public static void main(String[] args) {
File file = new File("E:\\A\\pdf/06264362.pdf");
try {
PDDocument doc = PDDocument.load(file);
PDFRenderer renderer = new PDFRenderer(doc);
int pageCount = doc.getNumberOfPages();
for (int i = 0; i < pageCount; i++) {
BufferedImage image = renderer.renderImageWithDPI(i, 296);
// BufferedImage image = renderer.renderImage(i, 2.5f);
ImageIO.write(image, "PNG", new File("E:\\A\\pdf/06264362.jpg"));
}
} catch (Exception e) {
}
}