跳转到内容

IText:修订间差异

维基百科,自由的百科全书
删除的内容 添加的内容
建立内容为“{{subst:Translating/auto|tfrom=en:IText|tpercent=0}} {{lowercase}} {{Infobox software | name = iText® | logo...”的新页面
(没有差异)

2014年7月15日 (二) 12:43的版本

iText®
File:Itextlogo.gif
開發者1T3XT BVBA
当前版本5.4.5(2013年12月2日,​10年前​(2013-12-02
源代码库 編輯維基數據鏈接
编程语言Java, C#
操作系统Cross-platform
类型Library
许可协议AGPLv3[1]
Proprietary
网站http://itextpdf.com/

iText is an open source library for creating and manipulating PDF files in Java. It was written by Bruno Lowagie, Paulo Soares, and others. Ohloh reports more than 10,000 commits by 26 different contributors since 2001[2] representing more than 1 million lines of code.[3] iText has a well established, mature codebase maintained by a large development team with stable Y-O-Y commits.[4] Using the COCOMO model, it took an estimated 250 man-years of effort starting with its first commit in November, 2000.[5]

As of version 5.0.0 (released Dec 7, 2009) iText is distributed under the Affero General Public License version 3. Previous versions of iText (Java up to 4.2.1 and C# up to 4.1.6) were distributed under the Mozilla Public License or the LGPL. iText is also available through a proprietary license, distributed by iText Software Corp. iText® is a registered trademark by 1T3XT BVBA.

There are two books about iText, written by the original creator of the software. In the first edition of "iText in Action", readers learn why things work the way they do in iText, complemented with simple examples. The second edition takes readers further with more real-life examples.[6] Some new books are under development. They will be available for free on Leanpub.[7]

iText has been ported to the .NET Framework under the name iTextSharp. iTextSharp is written in C# and it has a separate codebase, but it is synchronized to iText releases. All the examples from the second book were ported to C#,[8] but you can also find an abundance of .Net code samples written by different developers on the Code Project web site.[9] Individual developers such as Chris Haas often write blog posts on specific iTextSharp topics.[10]

By mid 2013 iText (Java) and iTextSharp (.NET) had been downloaded from SourceForge alone over 5 million times. In October 2013 downloads of iText from SourceForge were around 3,000 per week[11] while iTextSharp downloads were around 4,000 per week.[12]

Features

Developers will use iText to:

  • Dynamically generate PDF documents from XML file or databases
  • Serve PDF to a browser
  • Use PDF's many interactive features
  • Add bookmarks, page numbers, watermarks, barcodes, etc.
  • Split, concatenate and manipulate PDF pages
  • Automate filling out PDF forms
  • Add digital signatures to a PDF file

Typically, iText is used in projects that have one of the following requirements:

  • The content isn't available in advance: it's calculated based on user input or real-time database information.
  • The PDF files can't be produced manually due to the massive volume of content: a large number of pages or documents.
  • Documents need to be created in unattended mode, in a batch process.
  • The content needs to be customized or personalized; for instance, the name of the end user has to be printed on a number of pages.

Often you'll encounter these requirements in web applications, where content needs to be served dynamically to a browser. Normally you'd serve this information in the form of HTML, but for some documents, PDF is preferred over HTML for better printing quality, for identical representation on a variety of platforms, for security reasons, or to reduce the file size.

iText is fast and has a small memory footprint.[13] The iText application has a larger file size but stands out in nearly all other disciplines. The most significant difference is the time consumption, the PDF creation is more than 10 times faster as with the other applications. But also the CPU utilization of the iText application is lower compared to the CPU usage of the competitors.[14]

iText provides support for most advanced PDF features such as PKI-based signatures, 40-bit and 128-bit encryption, color correction, Tagged PDF, PDF forms (AcroForms), PDF/X, color management via ICC profiles and barcodes.

ISO standards support

Watch PDF and Standards, a talk by Adobe's PDF architect Leonard Rosenthol at the iText Summit in 2012.

History

A PDF library was developed by Bruno Lowagie in the winter of 1998 as in-house project at Ghent University to create a PDF documents application for the student administration. The library (formerly known as rugPdf) was a very small and complex library with minimum functionality, such as simply reading and writing PDF files. The developer had to be knowledgeable of PDF syntax, objects, operators and operands to work with the library. Leonard Rosenthol, PDF Architect at Adobe, lists iText as one of the early milestones in the history of openness of PDF.[17]

In 1999, Lowagie threw away the rugPdf code and wrote a new library, iText, from scratch. Lowagie created iText as a library that Java developers can use to create PDF documents without knowing PDF syntax[來源請求], and released it as a Free and Open Source Software (FOSS) product on February 14, 2000. In the summer of 2000, Paulo Soares joined the project and is now one of the main developers of new iText features.

In 2006, a first book was published "iText in Action, Creating and Manipulating PDF", of which more than 11,500 copies were sold.[18][19] Matt Stephens referred to iText as one of Java's "best-kept secrets".[20]

In 2007, SOA World Magazine listed iText as one of the ten Open Source solutions enterprises should be using.[21] James Gosling praised the iText library, using it in a new edition of Huckster.[22] The New York Times also used iText to create PDF versions of their public domain articles.[23]

iText is embedded in many products and services, including Eclipse BIRT, Jasper Reports, Red Hat JBoss Seam, Windward Reports, pdftk, and others.[24]

In late 2008, iText became available for proprietary license; and in early 2009 iText Software Corp. was formed to be the worldwide licensor of iText products.[25]

In 2010, the second edition of the book "iText in Action" was released. It was a complete rewrite with new examples.[26]

In 2011, iText was featured on Devoxx (The Java community conference) [27]

In 2013, Deloitte nominated the iText Software Group for the Technology Fast 50 Award in the Benelux. The company was ranked 10th in the Benelux and Third in Belgium.[28][29][30][31]

Licensing and fork

Versions of iText through 4.1.6/4.2.0 were released under the MPL and LGPL licenses, which allowed them to be used in closed-source software projects. At the end of 2009, with the release of iText 5, the license was switched to the Affero General Public License v3. Projects that do not want to provide their source code may either purchase a commercial license to iText 5 or continue using previous versions of iText under the more liberal license without any changes.[32][33] However, developer Bruno Lowagie has warned that versions prior to 5 may have included code that was not legally licensed under the LGPL, so that closed-source users of previous versions may be liable for copyright infringement. The AGPL license is not compatible with the GPL license, although an AGPL library can be linked to a GPL program.

Example

The following source code generates a PDF file as a Hello World example.

import java.io.FileOutputStream;
import com.itextpdf.text.Document;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;
 
public class ITextHelloWorld {
    public static void main(String args[]) {
        try {
            Document document = new Document();
            PdfWriter.getInstance(document, new FileOutputStream("HelloWorld.pdf"));
            document.open();
            document.add(new Paragraph("Hello World"));
            document.close();
        } catch (Exception e) {
            System.out.println(e);
        }
    }
}

Further reading

See also

References

  1. ^ The 'LICENSE.txt' file in iText source code repository. Itext.svn.sourceforge.net. [2013-10-26]. 
  2. ^  . Ohloh commits summary. Ohloh.net. 2013-08-19 [2013-10-26]. 
  3. ^  . Ohloh languages summary. Ohloh.net. 2013-08-19 [2013-10-26]. 
  4. ^  . Ohloh iText overview page. Ohloh.net. [2013-10-26]. 
  5. ^  . Ohloh Estimated development cost. Ohloh.net. 2013-08-19 [2013-10-26]. 
  6. ^ Book Review by John Griffin[[{{subst:DATE}}|{{subst:DATE}}]] [需要消歧义]
  7. ^ iText books on Leanpub. Leanpub.com. [2013-10-26]. 
  8. ^ port of the book examples to C#. Kuujinbo.info. [2013-10-26]. 
  9. ^ iText on the Code Project. Codeproject.com. [2013-10-26]. 
  10. ^ iTextSharp examples. Cjhaas.com. [2013-10-26]. 
  11. ^ iText on SourceForge. Sourceforge.net. [2013-10-26]. 
  12. ^ iTextSharp on SourceForge. Sourceforge.net. [2013-10-26]. 
  13. ^ forum post by Norman Richards, co-author of XDoclet in Action
  14. ^ Creating PDFs on Android — an evaluation by Stefan Fenz
  15. ^ PDF Association. How to create PDF/A-3 using iText (PDF). Pdfa.org. 2013-06-06 [2013-10-26]. 
  16. ^ iText bringing PDF/UA support to Java Implementations by Duff Johnson
  17. ^ History of PDF Openness by Leonard Rosenthol, Adobe's PDF Architect
  18. ^ Sales 1st edition. Lowagie.com. [2013-10-26]. 
  19. ^ How to write an IT bestseller (Dutch article). Istoire.be. 2012-09-12 [2013-10-26]. 
  20. ^ Stephens, Matt. Matt Stephens on iText. Adtmag.com. [2013-10-26]. 
  21. ^ SOA World Magazine. Soa.sys-con.com. [2013-10-26]. 
  22. ^ James Gosling praises iText. Blogs.oracle.com. 2007-09-20 [2013-10-26]. 
  23. ^ New York Times uses iText
  24. ^ list with references
  25. ^ Feature article in Wereldwijs, a monthly magazine by Flanders Investment and Trade (in Dutch). Epub01.publitas.com. [2013-10-26]. 
  26. ^ Sales 2nd edition. Itextpdf.com. [2013-10-26]. 
  27. ^ iText featured on Devoxx
  28. ^ Ranking Deloitte Technology Fast 50 Benelux
  29. ^ DataNews: 10 Belgians in Deloitte's Technology Fast 50 (Dutch article)
  30. ^ digimedia: the 5 Belgian digital start-ups with the fastest growth rate (Dutch article)
  31. ^ Deloitte's Fast 50 Newspaper article
  32. ^ mailing list discussion
  33. ^ Talk about the (A)GPL by Ywein Van den Brande, IP lawyer and technologist