作者:乔山办公网日期:
返回目录:office365
不是你代码的问题百,我主要用的度还是itextsharp,乱码主要是字体引起的。因为他知们的pdf主要还道是针对英文的,没有中文字体,版所以需要自权定义字体。http:///insus/p/4325350.html
我搞过一个项目有,把图片导出为pdf文件,需求跟你的不一样,代码也就不用给你看了。楼主百度一下“iTextSharp”这个东东就能知道,很容易的。
下载个赛酷ocr 用一下 能够转换各种pdf成可编辑的word
将pdf用软件打开 然后点击识别按钮 再点击插入按钮 就可以插入到word里了
还可以在word里进行编辑修改
1.使用iText导出PDF报表文件示例代码
e69da5e887aae79fa5e98193339/**
* 导出PDF示例
* @author RainTion
* @param args
*/
publicstaticvoid main(String[] args) {
try {
Document document = new Document();
PdfWriter. getInstance(document, new FileOutputStream("F:\\test.pdf" ));
document.open();
document.add(new Paragraph( "pride in me!" ));
document.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (DocumentException e) {
e.printStackTrace();
}
}
2.使用iText导出Word报表文件示例代码
/**
* 导出Word示例
* @author RainTion
* @param args
*/
publicstaticvoid main(String[] args) {
try {
Document document = new Document(PageSize.A4);
RtfWriter2. getInstance(document, new FileOutputStream("F:\\test.doc" ));
document.open();
Paragraph title = new Paragraph("你好 地球人..." );
document.add(title);
document.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (DocumentException e) {
e.printStackTrace();
}
}