This article from http://www.blogjava.net/sean/archive/2008/10/05/232577.htmlDue to work needs, today I briefly read the relevant documents about Java PDF generation. In summary, in addition to using the reporting platform and OOO's ancillary tools, there are currently two common approaches: itext and Apache fop. From the actual situation, let's take a look at the specific usage of the two processing PDF files with Chinese characters.
[
The origin of the problem
Not long ago done a JSP to generate a PDF report of the small project, it is an open vision. Some of the enterprise information through the network to form an HTML report, although IE can directly print the contents of the display, but from the interface, if the direct HTML display results printed out, it is not very beautiful. If you turn it into a PDF file and then print it, the printing effect will be much better.
Itext
Origin
Not long ago, I made a small project to generate PDF reports through JSP, opening my eyes. Some enterprise information forms Html reports through the network. Although IE can directly print the content displayed in the reports, from the perspective of the interface, if the Html display result is printed directly, not very nice. If you convert it into a PDF file and then print it, the printing effect will be much better.
IText Introduction
Use itext to operate PDF files
I wrote an article some time agoArticlePig0045 replied to Java's PDF file content, saying that you can use itext directly. I am very grateful because there were not many PDF files processed in the past and I didn't know about this component, pig0045 introduced me to a new method. Thank you! I'm so glad to hear that Google's itext i
Like me, you may be worried about generating Chinese characters when generating PDF files. Maybe you and I are the same. You can see that someone else provides a bunch of jar files and cannot find the download location, I also searched for the last base camp for a long time. It was close-up to help you and me ;)
Give yourself a witness for over an hour .-_#
You just need to go
Http://prdownloads.sourceforge.net/itext/
You can find all the things you w
Originally from: https://www.cnblogs.com/joann/p/5511905.htmlI'm just recording all the jar versions, because version conflicts and incompatibilities are a headache, requiring 5 jars altogether,Where Itextpdf is an upgraded version of Itext, and Itextpdf-5.5.jar the above version of the total number of pages do not need-1, the previous version must-1;Jfinal.jar can only be used in 2.0 version, with 3.0 of the report version is too high; hope to help p
I believe that friends who have used Itext know that Chinese display has always been a problem (the latest version of 5.5.7 is not directly integrated with Chinese fonts). Of course, such a problem, has long been a master to solve, that is, the use of Itextasian.jar. but instead of using Itextasian.jar, this article describes another workaround. Prior to this, you need to prepare only the Chinese font for Itextpdf-5.x.jar and a TTF format . For exam
1pdf Introduction650) this.width=650; "Title=" PDF Introduction "alt=" Wkiom1wryguhk_enaaeabxxdjyi529.jpg "src=" http://s3.51cto.com/wyfs02/M01/ 6f/18/wkiom1wryguhk_enaaeabxxdjyi529.jpg "/>2 Why Use ItextMost pages now provide the ability to download and automatically generate PDF forms. Itext This API is a good solution to the problem of PDF processing. simplifies the processing of PDFs.Itext is a Java component for creating, modifying, and generatin
Flying-saucer + iText + Freemarker exports pdf files and supports Chinese, css, and images,Preface
There is a requirement in the project. You need to export the contract content to pdf. IText is an open-source Java library that generates PDF documents. It can dynamically generate PDF files from XML or databases, and also encrypt and control permissions on documents, it also supports Java/C #, but the HTML P
Itext is a well-known open-source site SourceForge project. It is a Java class library used to generate PDF documents. using itext, you can not only generate PDF or RTF documents, but also convert XML and HTML files into PDF files.
Download the itext. jar file in the http://www.lowagie.com/iText/download.html and add
Document directory
Flying saucer and itext:
Generate a simple PDF
Use fly to generate content
Create a PDF file on the server
PDF is one of the most popular document formats so far. Generally, to create a PDF file, you need to use Adobe's API to generate it, but this is very troublesome. In order to easily generate PDF documents using HTML (XHTML), the following describes two open-source Java libraries: flying saucer and itext.Flying saucer an
Https://stackoverflow.com/questions/39286826/how-to-get-the-edited-text-from-itext-in-fabricjshttp://jsfiddle.net/srshah23/3pwb2404/2/------------------------------------------------------------------You can get your iText, text value by getting the text property of the IText object, like this; :canvas.getActiveObject().textAlso, get event after edit textYou coul
Learn itext from scratch create pdf1. Create a PDF with a streamImportJava.io.File;ImportJava.io.FileOutputStream;Importcom.itextpdf.text.*;ImportCom.itextpdf.text.pdf.PdfWriter; Public classPdftest { Public Static voidMain (string[] args)throwsException {/*** PDF Preparation defines the document file output stream and other files. pdf*/Document Pdfdoc=NewDocument (); //path output stream of the PDF file to be generatedFileOutputStream Pdffile =NewFil
Java itext package usage exception
Java itext package usage exception
Java. lang. NoClassDefFoundError: org/bouncycastle/asn1/ASN1Primitive exceptions must be introduced in pom when using itext.
Then java. lang. securityException: class "org. bouncycastle. asn1.ASN1Primitive "'s signer information does not match signer information of other classes in the s
1. IBM Developer Forum materials:
From Java applicationsProgramDynamic PDF file generationStep-by-step guide to the open-source itext library that simplifies the PDF creation process
Http://www.ibm.com/developerworks/cn/opensource/os-javapdf/
2. Solve Chinese input:
Download the latest itext-asian.jar,: http://sourceforge.net/projects/itext? Source = DLP un
In the newer version of Itext, there is still a problem with the support of Chinese, the information obtained on the network and the various attempts, the font file XX. TTF into the project, and then loaded into the basefont, feasible. As follows:
basefont font = basefont.createfont (path + msyh). TTF ", Basefont.identity_h, basefont.embedded);
Jar Package Required:
The jar package under the Itext-5.3.0.z
Itext the latest version of 5.0.1, the official binary version of the Asian font is still not directly integrated solution, loading Itextasian.jar to Classpath has not been working, prompted the following error:Font ' stsong-light ' with ' unigb-ucs2-h ' isn't recognizedThe whole day did not get to the path, had to go to view the source code, find the Cjkfont class, from which to seeInputStream is = Getresourcestream (Resource_path + "cjkfonts.propert
Java Itext Package Usage exception problemItext java.lang.noclassdeffounderror:org/bouncycastle/asn1/asn1primitive exceptions are required to be introduced into the POM when usingthen appears java.lang.SecurityException:class "Org.bouncycastle.asn1.ASN1Primitive" ' s signer information does not match Signer information of other classes in the same package this exception is due to the introduction of the Bcprov packet conflict was checked because the f
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.