PDFBOX:
网上的代码都是错的,不过可以自己写,但是最大的问题是不支持中文,同时也没有什么很好的解决办法。
xPDF:在Linux/Unix下使用可以有效的避免中文的问题,但是在Windows下使用就没有那么幸运了,官方提供的中文包都是Linux下的,不能在Windows下使用。
iText:主要用来生成PDF的Java包,我看到其中也有“PdfReader”方法,但是其中文化的问题如何解决?性能如何?有没有具体的实现代码?
其实我的要求很简单,就是把中文PDF中的内容读出来,不用格式化,读出来之后放到搜索引擎中去建索引,难道上天真的没有好生之德》这点小技术问题也要折磨我?????
看看 PDF-bean 吧.
iTextAsian.jar
up
路过。。。。。。。。。。。。。。
楼主加油啊
<%@
page import="java.io.*,
com.lowagie.text.*,
com.lowagie.text.pdf.*"
%><%
//
// Template JSP file for iText
// by Tal Liron
//
response.setContentType( "application/pdf" );
// step 1: creation of a document-object
Document document = new Document();
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a temporary buffer
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
PdfWriter.getInstance( document, buffer );
// step 3: we open the document
document.open();
// step 4: we add a paragraph to the document
document.add(new Paragraph("Hello World"));
// step 5: we close the document
document.close();
// step 6: we output the writer as bytes to the response output
DataOutput output = new DataOutputStream( response.getOutputStream() );
byte[] bytes = buffer.toByteArray();
response.setContentLength(bytes.length);
for( int i = 0; i < bytes.length; i++ ) { output.writeByte( bytes[i] ); }
%>
---------
iText的
iTextAsian.jar
mark学习
up