iText 相关:包括文档,源码
一些标记:
you’ll learn how to do the following:
■ Serve dynamically generated PDF to a web browser
■ Generate documents and reports based on data from an XML file or
a database
■ Create maps and ebooks, exploiting numerous interactive features available
in PDF
■ Add bookmarks, page numbers, watermarks, and other features to existing
PDF documents
■ Split and/or concatenate pages from existing PDF files
■ Fill out forms, add digital signatures, and much more
You’ll create these documents on the fly, meaning you aren’t going to use a desktop
application such as Adobe Acrobat. Instead, you’ll use an API to produce PDF
directly from your own applications, which is necessary when a project has one of
the following requirements:
■ The content needs to be served in a web environment, and PDF is preferred
over HTML for better printing quality, for security reasons, or to
reduce the file size.
■ The PDF files can’t be produced manually due to the volume (number of
pages/documents) or because the content isn’t available in advance (it’s calculated
and/or based on user input).
■ Documents need to be created in unattended mode (for instance, in a
batch process).
■ The content needs to be customized and/or personalized.
the Library (or Lesser) GNU Public License (LGPL),
the Mozilla Public License (MPL)
the Information and Communications Technology (ICT)
The default width of a table is 80 percent of the available width. Let’s do the
math for the table in figure 6.1: The width page is 595 pt minus the margins,
which are 36 pt. In short, the width of the table is (595 – (2 * 36)) * 80 percent, or
418.4 pt.
//这两者搭配使用
table.setTotalWidth(widths);
table.setLockedWidth(true);
document.add(table);
table.setWidthPercentage(50);
table.setHorizontalAlignment(Element.ALIGN_RIGHT);
document.add(table);
table.setHorizontalAlignment(Element.ALIGN_LEFT);
document.add(table);
PdfPTable table = new PdfPTable(3);
table.setTotalWidth(216f);
table.setLockedWidth(true);
The example sets the total width to 216 user units and has three columns, so
every column in the table is 1 in wide (216 user units / 3 = 72 user units = 1 in).
float[] widths1 = { 1f, 1f, 2f };
PdfPTable table = new PdfPTable(widths1);
float[] widths2 = { 2f, 1f, 1f };
table.setWidths(widths2);
/* chapter06/PdfPTableWithoutBorders.java */
PdfPTable table = new PdfPTable(3);
table.getDefaultCell().setBorder(PdfPCell.NO_BORDER);
PdfPCell cell =
new PdfPCell(new Paragraph("header with colspan 3"));
cell.setColspan(3);
table.addCell(cell);
table.addCell("1.1");
table.addCell("2.1");
table.addCell("3.1");
FAQ
Is it possible to have the column width change dynamically based on the content
of the cells? PDF isn’t HTML, and a PdfPTable is completely different
from an HTML table rendered in a browser; iText can’t calculate column
widths based on the content of the columns. The result would
depend on too many design decisions and wouldn’t always correspond
with what a developer expects. It’s better to have the developer define
the widths.
int width[] = ;
aTable.setWidths(width);
aTable.setWidth(80); // 占页面宽度 80%
aTable.setAutoFillEmptyCells(true); //自动填满
aTable.setDefaultHorizontalAlignment(Element.ALIGN_LEFT);
aTable.setDefaultVerticalAlignment(Element.ALIGN_MIDDLE);
aTable.setAutoFillEmptyCells(true); //自动填满
aTable.setPadding(1);
aTable.setSpacing(1);
aTable.setDefaultCellBorder(0);
aTable.setBorder(0);
java.lang.OutOfMemoryError: Java heap space
分享到:
相关推荐
itext是一个可以实现java导出word文档的一个第三方控件、可以用java自定义到word文档样式
java导出word,pdf等的工具jar包。
itext-5.1.2.zip、iTextAsian.jar、iText-5.0.3.zip、itext-5.1.0.zip、iText-2.1.7.jar、itext-rtf-2.1.7.jar
com.itextpdf.itextpdf.5.5.13.3 相关jar包和包含源码jar包 <groupId>com.itextpdf</groupId> <artifactId>itextpdf <version>5.5.13.3 下载地址为: ...
itext-asian-5.2.0及itextpdf-5.5.13.1两个jar包用于处理PDF文件
itext所有相关jar包.zip
用iText包document登api手动生成pdf文档,iText是种较原生的API,要生成的PDF内容较复杂时,使用会很繁琐。包含iText-2.0.8、iTextAsian、iTextAsianCmaps,仅自己可见...
downpour老大在它那篇文章里提到了怎样处理中文字体的,他可能高估了许多人的水平。其实说起来,很简单,就两点:一是在java代码里引用字体,二是在页面上引用字体
itext 7-7.0.5全部Jar包itext 7-7.0.5全部Jar包itext 7-7.0.5全部Jar包
IText相关的学习文档整理,包括操作PDF和word, 供其他开发人员使用和学习
相关教程 iText 简介 iText创建文档简介 iText入门实例 IText使用PDF模板输出报表的实践 我和iText第一次亲密接触 相关JAR iText-2.1.7.jar(核心) iTextAsian.jar(中文支持) iText-rups-2.1.7.jar iText-rtf-...
iTextAsian.jar iText.jar java生成pdf的相关jar包 目前已被替换,此版本可用
内含iText-5.0.5与iTextAsian包,绝对可用,博客上有相关开发文档,敬请关注
整理了一下iText的相关文档,此包中有API的帮助文档,以及一些说明和相关的示例代码。
itext相关jar
iText开发相关jar包 iText-5.0.2.jar(最新版)
java使用iText7生成pdf文档时,必须引入的jar包,包含相关的源码
itext-5.1.2.zip、iTextAsian.jar、iText-5.0.3.zip、itext-5.1.0.zip、iText-2.1.7.jar、itext-rtf-2.1.7.jar