java 判断字符串是否为null的四种方法:

您所在的位置:网站首页 java判断字符串非法字符是否存在的方法 java 判断字符串是否为null的四种方法:

java 判断字符串是否为null的四种方法:

2023-10-23 22:16| 来源: 网络整理| 查看: 265

使用pdfBox实现pdf转图片,解决中文方块乱码等问题

为什么要叫左木: [code=java] public static void testDrawLineText() throws Exception { PDDocument document = new PDDocument(); PDPage page1 = new PDPage(PDRectangle.A4); document.addPage(page1); PDPageContentStream contentStream = new PDPageContentStream(document, page1); OTFParser otfParser = new OTFParser(false, true); OpenTypeFont otf = otfParser.parse(new File("D:/pdfbox/SourceHanSansCN-Heavy.otf")); PDFont font = PDType0Font.load(document, otf, false); String childContent = "测试啊泽11"; font.encode(childContent); contentStream.beginText(); contentStream.setCharacterSpacing(0.5f); contentStream.setFont(font, 15); contentStream.showText(childContent); contentStream.endText(); contentStream.close(); document.save("D:/pdfbox/testPdf.pdf"); document.close(); } [/code]



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3