Java三方---->pdf框架之IText的使用
在企业的信息系统中,报表处理一直占比较重要的作用t。通过在服务器端使用Jsp或JavaBean生成PDF报表,客户端采用超链接显示或下载得到生成的报表,这样就很好的解决了B/S系统的报表处理问题。今天我们就开始Itext的学习。我们这里主要通过Java代码来使Itext的学习更加形象。excel框架之POI的使用: Java三方---->excel框架之POI的使用一
Itext框架的简单实例
项目结构如下,我们使用了junit的方式进行测试。
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVcAAAFwCAIAAACD+q/BAAAgAElEQVR4nO2df1QUV4LvOe+d3Z3dbHbfvJnJzpm3O2/fnn3uzJh58xwzajo/JtFEYzarSeZlo5OZJJPsdNaMu5PEGH9rVMCWaGwFjCIRBEVEwIjQIoqICCq/FBREG+SnAv0Lmh9NgWC9P7rpvlV1q7pouumuru/n1EnsqnurLhzup++trvvtCBYAoG4igt0AAECQ8Y8FLLbe/aknYg9mxB7MSDx8on9gkDzaaet/a9sJv1wIAOB3/GMBfcLRrntN1u5WS3dLQ9312P2p5NEOc9+8z1LF6gIAgstkLdBtsm7ZFnuraOtg467hxp2Oum2mkg37t69ZuT5m5fqYLdtiu01WWACAUGayFtiyLbbvfiFrv0jZxobGHjh6euxiFjDqNREREREREVoDa9BG8NEaJtk2AIAcJmuBVZviWNtZ+sayztsBEmMBgzZCozdyd/jQ+416DaQBgI94t0BRUZFOpxM7umL916zpJH17ODbvs9QzlU3RRy/9bkcOtTosAEDQ8WKBwsLC6dOnT5s2TazAHz49xN5Lc25j7UfOnjj8eWT6H1ek/nFFav2tezmX7zy3ImX+6iNXG+5ln7wmrC7DAp65grOkUa9xzxYM2ogIrdYzmeCeCwAgBykLOBWwZMkSCQv8VpvMtiayrYlDd77esCU99pu6k61jzi23bczKPHQWq+8e+uCTLGF1bxYgj3ve8F17PQcxFgDAd0Qt4FbA0qVLJSzw6m8OsU27Hbf2fLTm2BfZTRm3hoXbgRLL7z81tN+zC6t7sYDgnuF4YecBiiAAABOFbgFSAdIWWPD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SD8V7L1mXn3NG7iPKubORvDabHbeAMFhR8jcg2nh3SY1ej9iF8ERhFsjMzBwZGdn+d4+kvvlIdeWflRZ8K+nFR/V//8iev/12/vH9pUWxNxsuVlcknS1OGRkZyczMFJxAJLCQ3p3ExgJiIYXU1EMenEhD4kS8ZARhaopRryXTEiSaLT0WmHBkIyfMBRYIRxRmgYyMDIZh9k5/NP/N/3Z0xaPJH/zVmae/l/g//jr20b88k/xOafoTl79+ue3wYzmprzIMk5GRITiBSFTZhCwgGlIolnFCwKvrfskdH5DDAbI4fzTgqwV8DGtDBFOYojALHD161OFwJE//duWs71cs+m7Fa9/P+/vHTv3Dd/fP/6eyj//89r7vdR18ZOD4Xzel/MDhcBw9elRwggBZQNhnJ24B6eLkOzEtPxUWAD6jMAscPny4v7//y8d/lDvjscs/f+zynL/J/PvHcuc/UpP0A+O+RwxrvhX/zl9cj/yT2/u/09/ff/jwYcEJRAILiQE8UUL2jIA+qvc6IyB7Nm+mIBAOZ24g3WyaBTwlJxzZiBlB2KMwCxw6dMhut3/25JNf/fixY0/NTPp/i7/8u+8Vv/2tnoSInI//ZOY/fv/73/3Ob2b/l+rtj9rt9kOHDglOIBZY6Blsa7RaTt8ZH53LCCmUYwHuTUA9726AxBk9hykt5Oz0PC/gaTPXAhOIbCQui7uD4YrCLJCUlNTT05O4Y0v2ji8KclLLLufGvjHtbmyENTYi5b0//Z/f+e9/9cijHzz7X+v0j/b09CQlJQW7vSHIJD4+xIwgTFGYBRITE61Wa1l5cV1d3YXLZ86XnT554P2GhO9c2fHDC5F/u/6176z71bcLN3/3dOx8q9WamJgY7Pbyb/qFwKf3E31igvaBBggvFGaBhIQEs2wSEhKC3d4QZIJjAWKeAgWEKwqzwP4JEuz2AqAAFGYBAIDfgQUAUDuwAABqBxYAQO3AAgCoHVgAALUDCwCgdmABANQOLACA2oEFAFA7/x+Zm1CuICQDeAAAAABJRU5ErkJggg==" alt="" />
一、 简单的Itext实例
@Test
public void createPDF_1() throws Exception {
Document doc = new Document();// 创建一个PDF文档,我们的PDF内容都写在上面
PdfWriter.getInstance(doc, new FileOutputStream(new File("pdf/Linux1.pdf"))); // 将pdf文档写入文件
doc.open();
doc.add(new Paragraph("Hello World"));// 在文档上写“Hello World”
doc.close();
}
生成的pdf效果图:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAScAAABsCAIAAACn0OMNAAAIKklEQVR4nO3af0hT3x/H8Sm0NLFtzR+zKZmmpJGVQUwR/xCskAwzI4I0YlbkH0lJQgSOrJD8sRDJSFpISpRRRJhEZmJqWkq6Qrcw1ElaCzeHbrpx7+V+/rh8Ln7TRL58eX8VX48/z9k9ZwOf7N4zJd0AQEvy/34DAGuOpLu7mwcAQqgOgBqqA6CG6gCooToAaqgOgBqqA6CG6gCooToAaqgOgBqqA6CG6gCooToAaqgOgBqqA6CG6gCooToAaqgOgBqqA6CG6gCooToAaqgOgBqqA6CG6gCooToAaqgOgBqqA6CG6gCooToAaqgOgBqqA6CG6gCooToAaqgOgBqqA6CG6gCooToAaqgOgBqqA6CG6gCooToAaqgOgBqqA6CG6gCooToAaqgOgBqqA6CG6gCooToAaqgOgBqqA6CG6gCooToAaqgOgBqqA6CG6gCooToAaqgOgBqqA6CG6gCorcTqfv36VVpa+u7du/mDHMe9ePGisrLS4XAscS3Lsk+ePKmtrXW73X19faWlpePj48vcd3x8/NatW/P39Xg8Dx8+vHbt2uDgoDhos9nKy8ubmpqW/4nsdntFRUV7e/vCKZvNVlFR0dnZufzVYLVbidX19fXJ5fIrV66wLCsOejye7OzsLVu2jIyMLHGt2+0+fPhwUlLS1NRUTU2NXC7v6upa5r5jY2PR0dGZmZlut1sYGR4eDg8Pl0gkOp2O4zhh8NWrV35+fnfv3l3+JxoaGgoKCiouLhYXmT8VGBhYUlKy/NVgtUN1/3FtVlZWTEyM+PX4/PlzpVIZHR2dkpIyPT3N8zzHccXFxQqFore3d/mfCNXBfKu4urm5uZcvX+p0Or1ebzabhcElqnO5XM+ePSsqKtLr9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kpKSDh48ODc3J1zIMExeXl54ePjo6KjwXNfR0SFMidXZ7fbk5OTU1FSXyyVMWSyWiIgIVLemrMrqxsfHY2JiMjIyxL9dk8l05syZpqamRasTjkBycnLExjo6OmQy2aJH+Xa7PSkpKSUlJTAwUHhu5Hl+ZmYmNTVVo9GoVCrhZ3SGYU6dOhUZGSmeqdrt9sTERGHrv1UnPJFGREQMDw8LU21tbf7+/qhuTVmV1bEsq9PppFKpTqebmpoaGhrav3+/QqF4//79otWxLFtYWOjr66vX651Op9Fo1Gg0oaGhX758Wbi78IOBRCKJjY2dmJgQBjmO0+l0Eolkx44d4uCbN2/8/f2PHTtmsVgmJyfz8/OlUml1dTXHcX+rjuO41tZWuVx+9OjRkZERo9GYkJCA05S1ZlVWx/P8zMxMYWGhj4+P8ES3efPmx48fcxz3t18OHA7HhQsXpFKp8Pq4uLg//uNsvoaGBqlUmp2dPf/+8/Xr135+fvMHWZatr68PCQkR1lQoFGVlZcID2xLVcRxXX1+vUqkkEomXl1daWpparUZ1a8pKrG75ZmZmjEajyWQSDzOX5nA4+vv7LRbLwhvL/xrDMCaTaXBwUDwgWQ632z04ODg2Nva/ehuwiqzu6gBWI1QHQA3VAVBDdQDUUB0ANVQHQA3VAVBDdQDUUB0ANVQHQA3VAVBDdQDUUB0ANVQHQA3VAVBDdQDUUB0ANVQHQA3VAVBDdQDUUB0ANVQHQA3VAVBDdQDUUB0ANVQHQA3VAVBDdQDUUB0ANVQHQA3VAVBDdQDUUB0AtX8AcKJ5jTyegsgAAAAASUVORK5CYII=" alt="" />
二、 设置页面的大小
@Test
public void createPDF_2() throws Exception {
Rectangle pageSize = new Rectangle(216f, 720f);
Document doc = new Document(pageSize, 30, 30, 50, 50);// 设置页面的大小
PdfWriter.getInstance(doc, new FileOutputStream(new File("pdf/Linux2.pdf"))); // 将pdf文档写入文件
doc.open();
doc.add(new Paragraph("Hello World"));// 在文档上写“Hello World”
doc.close();
}
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhE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EZBAioAEUgQkkCIggRQBCaQISCBFQAIpAhJIEZBAioAEUgQkkCIggRQBCaQISCBFQAIpAhJIEZBAioAEUgQkkCIggRQBCaQISCBFQAIpAhJIEZBAioAEUgQkTJPivwG9VjX9hP3D2gAAAABJRU5ErkJggg==" alt="" />
三、 设置使用底层方法创建PDF
@Test
public void createPDF_3() throws Exception {
OutputStream stream = new FileOutputStream(new File("pdf/Linux3.pdf"));
Document doc = new Document();
PdfWriter writer = PdfWriter.getInstance(doc, stream);
doc.open();
PdfContentByte canvas = writer.getDirectContent();// 获得PDF文本流,用于在上面画图
writer.setCompressionLevel(0);
canvas.saveState();
canvas.beginText();
canvas.moveText(36, 788);// 从这个位置开始画
canvas.setFontAndSize(BaseFont.createFont(), 12);// 设置字体
canvas.showText("Hello Wrold");// 输出内容
canvas.endText();
canvas.restoreState();
doc.close();
}F
四、 设置背景色和偏移量
@Test
public void createPDF_4() throws Exception {
OutputStream stream = new FileOutputStream(new File("pdf/Linux4.pdf"));
BaseFont baseFont = BaseFont.createFont("font/SIMKAI.TTF", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
// 设置16号倾斜字体
Font font = new Font(baseFont, 16, Font.ITALIC);
// 设置字体颜色为红色
font.setColor(255, 0, 0);
// 创建一个PDF文档
Document doc = new Document();
// 将pdf文档写入什么地方
PdfWriter writer = PdfWriter.getInstance(doc, stream);
// 设置行间距
writer.setInitialLeading(30f);
// 打开pdf文档
doc.open();
// 在pdf文档中写入内容,并指定字体
doc.add(new Chunk("输出中文", font));
// 换行
doc.add(Chunk.NEWLINE);
doc.add(new Chunk("I love you.")); // 设置背景色
doc.add(Chunk.NEWLINE);
Chunk chunk = new Chunk("This is Chunk");
chunk.setBackground(BaseColor.YELLOW);
doc.add(chunk); // 向上偏移6个单位,上标
Chunk chunk1 = new Chunk("This is rise chunk");
chunk1.setTextRise(6);
doc.add(chunk1);
// 关闭pdf文档
doc.close();
}
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA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vnz8sXBwEHv3soZEHeOPUsMjR0RIiNBqzWNSU0X37mLr1iZr2JLxcnqPHuKNN+R5DPPt5k3h4yOGDBFabXM1vHlTqNVixQrzZmNpqRg6tEU1lGdRysrE+PHC01Ncv84aEnWAP0oNv/tOODqKpUtFebm4f1988IHo2VP8+GOTNWzJeLl7GxIirKzE9OniyBGRmyv27xeDBwtHR/Htt7V7yo3WsLxcjBkjnnxSnD4tbt0Sb74punVrRQ0BkZYmVCqxYIHcXyaidvmj1FCvF+vWif9eGyecnMTGjc1dYdOS8fKm04n164WbW+0nan18RHKyOX/N1BAQKSniv1fLiYAAMXOmmDChFTU0mURYmLC1Fbt3s4ZE7dXJatjOW3W1yM4WOTmipqaDx5tM4uZN8fPP4vbt1n3sxGAQV6+KW7fa/2EVImqXP1YNu/SNiNqFNewyNyJql85SQyKiXxZrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERBJrSEQEsIZERNL/A+At5NfS9bdRAAAAAElFTkSuQmCC" alt="" />
五、 设置行间距
Test
public void createPDF_5() throws Exception {
Document doc = new Document();// 创建一个PDF文档,我们的PDF内容都写在上面
PdfWriter.getInstance(doc, new FileOutputStream(new File("pdf/Linux5.pdf"))); // 将pdf文档写入文件
doc.open(); Phrase phrase = new Phrase();
// 设置行间距,默认为1.5倍
phrase.setLeading(70);
// 这种phrase的内容
phrase.add(new Chunk("This is frist chunk"));
phrase.add(Chunk.NEWLINE);
phrase.add(new Chunk("This is second chunk"));
doc.add(phrase); new Paragraph();
doc.add(new Paragraph("This is first paragraph"));
doc.add(new Paragraph("This is second paragraph"));
doc.close();
}
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVAAAAFUCAIAAAD9G/OYAAAgAElEQVR4nO3de1BTZ8LH8YAECAhJSLgEsEXE4GWqVCtYUWm3rra76tYubLV2cStWu666a711qgW8oaUaxlaKdqBqWyp2RCkiOgVkBbl4qXK/DAjBBrmMkayQJtnkzHn/eGbP5AWCwXoBnt/nvyRPzjkh+ZJzDuEJrxQAqMF71hsAAE8PggegCIIHoAiCB6AIjwUAaiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKIHgAiiB4AIogeACKDK3gu7q6FArFjv7ExcW1tLSUl5fHx8e3tLT0uiPDMGfOnElOTtZqtdasaLDjyV0uXrwYGRm5fPny0tLSR1gawzB6vd7K1bEsa+nBPppHeMgw8gyt4JVK5aRJkxwdHR0dHe3s7Hg8np2dHbno4+NTXFx8/PhxkUh0+fLlXnc0GAxLly6dPn36vXv3rFn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ASiC4AEoguABKILgASiC4AEoguABKILgASiC4AEoguABKILgASiC4AEoguABKILgASiC4AEoguABKILgASiC4AEo8n/vZlXK37fMmgAAAABJRU5ErkJggg==" alt="" />
六、 设置段间距
@Test
public void createPDF_6() throws Exception {
Document doc = new Document(PageSize.A5);
PdfWriter.getInstance(doc, new FileOutputStream(new File("pdf/Linux6.pdf"))); // 将pdf文档写入文件
doc.open();
Paragraph paragraph1 = new Paragraph("This is first paragraph");
// 居中显示
paragraph1.setAlignment(Element.ALIGN_CENTER);
Paragraph paragraph2 = new Paragraph("This is second paragraph");
paragraph2.setAlignment(Element.ALIGN_RIGHT);
// 段落2与段落2的间距加大50个单位
paragraph2.setSpacingAfter(50);
// 段落2与段落1的间距加大100个单位
paragraph2.setSpacingBefore(100);
Paragraph paragraph3 = new Paragraph("This is third paragraph,It's too long and show in new line");
// 段落3距离左边100个单位显示
paragraph3.setIndentationLeft(100);
// 段落3的第一行距离左边50个单位显示
paragraph3.setFirstLineIndent(50);
doc.add(paragraph1);
doc.add(paragraph2);
doc.add(paragraph3);
doc.close();
}
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkEAAAGFCAIAAAB197DFAAAgAElEQVR4nO3de1RU9cL4/0Ec7gwD5CiipKKoeDyRKJRPWZaXNF3mLTWfdUrNOkcfTfOYeVTw8qRJXgIts/AWHm95TATTR8ELKtqShSKBsEAuhsAQgyxgglkze+3fH3t95zvfAUbwsROffu/XfzN778/s2cOaN/vCRnUDAAAxqX7vFQAA4DHRMACAqGgYAEBUNAwAIKq2NkwGAKADoGEAAFHRMACAqGgYAEBUNAwAICoaBgAQFQ0DAIiKhgEAREXDAACiomEAAFHRMACAqGgYAEBUNAwAICoaBgAQFQ0DAIiKhgEAREXDAACiomEAAFHRMACAqGgYAEBUNAwAICoaBgAQFQ0DAIiKhgEAREXDAACiomEAAFHRMACAqGgYAEBUNAwAICoaBgAQFQ0DAIiKhgEAREXDAACiomEAAFHRMACAqGgYAEBUNAwAICoa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ROXL19+6qmn/vWvf+3du3fAgAHffvutTqc7e/bsp59+GhwcXFJSYvcqDhrW/KVLS0tfffXV5i/dv3//srKyx/3Mgd8HDcMTVl9fP23aNDc3t9mzZ+/cufPGjRs7d+7UaDTWhlmvTbdt2CeffOLr63v79m1lELPZPGfOnNb2DBobG8+ePbt48eJevXo5OTlFR0f/+uuvdtclWht2/fp1Hx+fzz//3Lq4ckBy1qxZv/766/Lly5999tmvvvqqd+/eP/3007vvvjtixIj//u//7tOnT1FRkd3rNm+Y9W/FHDes+Vuurq7evn27h4fHzp07U2xcvHixqqpKr9eHh4cvXrz4nXfemTx58r179/r377969eqxY8e+9dZbtteqKBw0rPlL379/f/To0YMGDUpMTLR96Rs3brTxr/GAjoOG4QnLysry8/P7+9//rnx1KueWvL29L1++7OAL/cSJE15eXt9++60ySE1NzfPPP9+8YcXFxYsWLUpJSVEeKt/1o0aNevjwYWsNKy0t7du37+zZs61f0FevXvXx8YmOjpYk6fTp0zqd7pVXXhk1alRdXd3+/fufeuqpP//5z9OnT2/+hf5kG5aUlOTp6WndQZQk6dixYwsXLiwuLlau3QgNDQ0JCYmJiWlsbHzzzTcHDRrUtWvXvXv3Nt/m7WqYXq9fuHBhQECA9TLFhoaGqKiozz77rLGxsX0fNvB7o2F4wvLz8wMDA8eOHavX600m04EDB3x9fT09Pc+dO+fgC726unr48OF9+vRJSUmprKz88MMPnZ2dW7ymY/DgwcOGDcvOzjabzSdPnvT391+6dKmD/TAlom5ublu2bKmvr8/KynruuecCAwOVfb4HDx6EhoaqVKpVq1ZJknTnzp2nnnrK2dn566+/bv7WnmzDDAbDiBEjAgICjh071tDQcPr06cDAwBdeeMFgMMiynJiY6ObmprRfluXY2FgnJ6fu3bvfvXu3+Yq1q2HV1dVXrlzx8/MbOXJkVlbWw4cP161bp1ar165dy1+VQTg0DE+YxWKJjY318PBwcnJycnLq37//hg0btFptXFycg29VWZZzcnJefPFF67mZF154ocVjiampqcHBwcpsnTp1mj59ekVFRfO/cbY2TJbl2traDz74wMXFRVlq8ODB1vNYyok3Nze3U6dOybKsXAfYtWtX65k5W0+2YbIs5+XljRo1ynpGasSIEcrfrsmyfP/+/ZCQkNDQUOWqxfT0dB8fnwkTJrR4E6n2NkySpOPHjwcFBSmv6+LisnTpUuWPCgCx0DD8Jmpra2/dulVUVNSuy7UlSSopKbl7927zUz62LBZLYWFhRkZGu+7KUVtbe/v27dLS0o52BXlFRUVGRsa//3oKi8VSUFBw69YtLkeEuGgYAEBUNAwAICoaBgAQFQ0DAIiKhgEAREXDAACiomEAAFHRMACAqGgYAEBUNAwAICoaBgAQFQ0DAIiKhgEAREXDAACiomEAAFHRMACAqGgYAEBUNAwAICoaBgAQFQ0DAIiKhgEAREXDAACiomEAAFHRMACAqGgYAEBUNAwAICoaBgAQFQ0DAIiKhgEAREXDAACiomEAAFHRMACAqGgYAEBUNAwAICoaBgAQFQ0DAIiKhgEAREXDAACiomEAAFHZtun/A11KXEMMZViyAAAAAElFTkSuQmCC" alt="" />
七、 从List中写入数据
@Test
public void createPDF_7() throws Exception {
Document doc = new Document(PageSize.A5);
PdfWriter.getInstance(doc, new FileOutputStream(new File("pdf/Linux7.pdf"))); // 将pdf文档写入文件
doc.open();
// 创建有序List
// 如果是有序,前面会出现序号
// 将前面的序号改为字母,默认为数组
List items = new List(List.ORDERED, List.ALPHABETICAL);
// 前面的标示符小写,默认为大写
items.setLowercase(List.LOWERCASE); for (int i = 0; i < 10; i++) {
ListItem item = new ListItem("This is " + (i + 1) + " listItem");
items.add(item);
}
doc.add(items);
doc.close();
}
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUUAAAFFCAIAAAD0FmgKAAAeNklEQVR4nO3deVCTd+LH8ShErgTCYTiiHVTEiqt4Yj1qwd1qu9WxHr3Wo7WsFZfaAaui1MpSR1DwQFzFLmAVz3VXWA+q440HassggkAcLnEi1xDCQLIkmzzz/P54Zp/JL3mIQYs+z5fP668leZ4A3b5LEpIPonsAQApRT0+gAYCv0DMAO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v3ZDIZXpYIQAu6Z6PRGBUV5ejoOHDgwLt3777uLwfg9RNwzxRF3blzJycnh3kpEgAIuGcAsICeAciBngHIgZ4ByIGeAciBngHIgZ4ByIGeAciBngHIgZ4ByIGeAciBngHIgZ4ByIGeAciBngHIgZ4ByIGeAciBngHIgZ4ByIGeAciBngHIgZ4ByIGeAciBngHIgZ4ByIGeAciBngHIgZ4ByIGeAciBngHIgZ4ByIGeAcjxfyvJ2ByMeLQaAAAAAElFTkSuQmCC" alt="" />
八、 更改列表的标识
@Test
public void createPDF_8() throws Exception {
Document doc = new Document();
PdfWriter.getInstance(doc, new FileOutputStream(new File("pdf/Linux8.pdf"))); // 将pdf文档写入文件
doc.open();
List items = new List(List.UNORDERED);
// 设置为false后,可以更改标识的宽度
items.setAutoindent(false);
// 标识宽度100
items.setSymbolIndent(100);
// 标识的前半部分显示内容
items.setPreSymbol("Data");
// 标识后半部分显示内容
items.setPostSymbol(":"); for (int i = 0; i < 10; i++) {
ListItem item = new ListItem("This is " + (i + 1) + " listItem");
items.add(item);
}
doc.add(items);
doc.close();
}
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbIAAAFFCAIAAAAGhv/qAAAZvklEQVR4nO3da3BU9eGH8Y1kQ7JLSEIQBneAiCHhUiAQiLTD1VZBUhsCRAdaKDYqMgi1RUQcmgS0gAI2AW37b4GhdIbLQDTcGZCLYEUMA6SJCMOdJmDS3JrddHdnz875vzjtmf3twmmWI8Nv9fm8c3P2MoDP7C3na/kcABDA8qAfAADIhSwCgIAsAoCALAKAgCwCgIAsAoDgrllUAeA7iSwCgIAsAoCALAKAgCwCgIAsAoCALAKAgCwCgIAsAoCALAKAgCwCgIAsAoCALAKAgCwCgIAsAoCALAKAgCwCgIAsAoCALAKAgCwCgIAsAoCALAKAgCwCgIAsAoCALAKAgCwCgIAsAoCALAKAgCwCgIAsAoCALAKAgCwCgIAsAoCALAKAgCwCgIAsAoCALAKAgCwCgIAsAoCALAKAgCwCgIAsAoC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vTTT9uYxXPnziUlJeXn5x86dEjfjz58+PCFCxdYv5JQZGQR0pJtJ1oXlEXtphISEvbv36/955kzZ5KTk5cvX96WCem9e/fOnTtXHxo8dOiQ3W5fu3Zt4E60evcJ6Zqamr59+06cOFH/ss5XX3314osv7tu3jyxKiCzCFNl2onWhWaypqRk4cGBmZua5c+cuXbr05JNP9uzZ8/z580FXvGMWd+7cabPZ5s2b19DQ0NLSsnDhwvj4+IMHDwbtRN9tQvqf//xnYWFhTExMYWFhU1PTpUuXnnrqqaSkpOPHj5NFCZFFmCLbTrQuNIuqqn766afp6enaLTgcjt27d4de8Y5Z9Hg8b7/9ts1m067bsWPHVatWeb3eoJ3owCwG/cjpdL7++uuxsbHaLTzyyCParjRZlBBZxIN0n3aijW/hwoULVVVVBh/X3I3L5aqoqKiqqgp65R60E23wI23A+quvvuILNzIjiwAgIIsAICCLACAgiwAgIIsAICCLACAgiwAgIIsAICCLACAgiwAgIIsAICCLACAgiwAgIIsAICCLACAgiwAgIIsAICCLACAgiwAgIIsAICCLACAgiwAgIIsAICCLACAgiwAgIIsAICCLACAgiwAgIIsAIPh/jiWPGrVTeycAAAAASUVORK5CYII=" alt="" />
九、 插入横线
@Test
public void createPDF_9() throws Exception {
Document doc = new Document();
PdfWriter writer = PdfWriter.getInstance(doc, new FileOutputStream(new File("pdf/Linux9.pdf"))); // 将pdf文档写入文件
doc.open();
PdfContentByte canvas = writer.getDirectContentUnder();// 获取画布
canvas.beginText();// 开始输入内容
canvas.setFontAndSize(BaseFont.createFont(), 50);// 设置字体
canvas.showTextAligned(Element.ALIGN_CENTER, "<", 200f, 200f, 0);
// 通过选择180度
canvas.showTextAligned(Element.ALIGN_CENTER, "<", 200f, 100f, 180);
canvas.endText();// 结束输入内容 // 参数
// 1.线宽度
// 2.直线长度,是个百分百,0-100之间
// 3.直线颜色
// 4.直线位置
// 5.上下移动位置
LineSeparator line = new LineSeparator(2f, 100, BaseColor.RED, Element.ALIGN_CENTER, -5f);
doc.add(line); DottedLineSeparator dottedLine = new DottedLineSeparator();
// 下移5个单位
dottedLine.setOffset(-5);
// 设置点之间的距离
dottedLine.setGap(20);
new Paragraph();
doc.add(new Paragraph("This is first paragraph"));
doc.add(dottedLine); // 设置一个坐标点,用于goTop定位
Anchor topLine = new Anchor("This name is US");
topLine.setName("US");
doc.add(topLine);
doc.add(line);
// 链接到百度
Anchor anchor = new Anchor("This is Anchor");
anchor.setReference("http://www.baidu.com"); for (int i = 0; i < 100; i++) {
doc.add(new Paragraph("This is " + (i + 1) + "line"));
} // 点击后,跳到topLine的位置
Anchor goTop = new Anchor("Go Top");
goTop.setReference("#US");
doc.add(goTop);
doc.add(anchor); // 关闭pdf文档
doc.close();
}
十、 插入段落
@Test
public void createPDF_10() throws Exception {
Document doc = new Document();
PdfWriter.getInstance(doc, new FileOutputStream(new File("pdf/Linux10.pdf"))); // 将pdf文档写入文件
doc.open();
Chunk top = new Chunk("This is top");
top.setLocalDestination("Top");
Paragraph topParagraph = new Paragraph(top);
doc.add(topParagraph); for (int i = 0; i < 100; i++) {
doc.add(new Paragraph("This is " + (i + 1) + "line"));
} Chunk goTop = new Chunk("Go to top");
goTop.setLocalGoto("Top");
Paragraph bottomParagraph = new Paragraph(goTop);
doc.add(bottomParagraph);
// 关闭pdf文档
doc.close();
}
十一、 插入图片:
@Test
public void createPDF_11() throws Exception {
Document doc = new Document();
PdfWriter.getInstance(doc, new FileOutputStream(new File("pdf/Linux11.pdf"))); // 将pdf文档写入文件
doc.open();
Image image = Image.getInstance("photo/button_default.png"); image.setAlignment(Image.ALIGN_RIGHT);
// 设置边框
image.setBorder(Image.BOX);
image.setBorderWidth(2);
image.setBorderColor(BaseColor.RED);
// 设置图片大小
/*
* ScaleToFit有两个参数,指的是长和宽的最大值,但是图片的长宽比还是不会变的
* ScaleAbsoluteHeight设置图片的高度,不管长宽比 ScaleAbsoluteWidth设置图片的宽度,不管长宽比
* ScalePercent等比例缩放
*/
// image.ScaleToFit(1000, 1000);
// image.ScaleAbsoluteHeight(100f);
// image.ScaleAbsoluteWidth(100f); image.scalePercent(50f);
// 图片旋转30度
image.setRotationDegrees(30); doc.add(image);
// 关闭pdf文档
doc.close();
}
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAysAAACgCAIAAACDqmSNAAAPUElEQVR4nO3W+1fVdb7H8Q8bEBQFUfMyoeWt1C5qtSzNcmmOleZamrnGdPRo2qhZmZ0sp3U0T8dMl5ZzNMfJOo0eL4scpVQ8DAhTjqu9NwjITUSubmF7QUJErvvy/ZwfmOMphxRx8/mwN8/Hev0Bn8/7p6ewAgAAQC2h+wEAAABtDgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgWuMFJgEAANBcFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqFBgAAIBqN88vKSUFBgAA4GEUGAAAgGoUGAAAgGoUGAAAgGoUGAAAgGoUGAAAgGoUGAAA8BKHD8vJk6XTqfsdHkCBAQCAVi87+8pjY6QQUgi5aZPu13gABQYAAFqx8vLzU+YZJv9rAx/M3BRVMmOJMyRUXr6s+1l3igIDAACtksslt251hIY7OnfNf3uD+WixOcFujc6t79JdLlyo+3F3igIDAACtT0JCVd9B7oBA+/RFiYdyzAn268t7d5NhMsn0dN1PvCMUGAAAaE0KCspGPyeFKH9ifOrO4z9tr38svqRy0LCKYaN0P/SOUGAAAKB1uHatZMYSd2C76j4DTq3b00h7/d8ythwyhJD79+t+cfNR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fboP4MUoMAAAvJUlpqCu+92XJkxXkV9Hi/OXrXeEdXGEhhcsXStdLt2/924UGAAAXuzMym2GEOlbj7RofmVuOlDV/wHD5H9+6iuJ357S/WlfQIEBAODFzAn2qw89Xjn4EXN8SUu0V/LexLIxL0ghrjw25uRX3+v+ru+gwAAA8G5pn8cafn65KzZ7tr2sR/KLZy11BwbV3N03e80O3b/0NRQYAADezZxgvzhxZl23ntboPM/kV3xJ7u+31HXr5QzpVLRwpXQ4dH/RB1FgAAB4vaQDGc6QTsWz3rzz/ErfeqRyyKOGn9/FiS8n7U/X/TOfRYEBAOALihatcgcGpeyxNru9TuxLvTRhuiHE1YdGpP3pr7o/5OMoMAAAfIEl9mxNRP+ypyc1o70sMYW2+StcwR3quv/qzMptur/SJlBgAAD4iOyPdkohsj7df1v5lbP6y9pefVxBwef+5V9lTY3uT7QVFBgAAD7CnGAvHzG2qt8Q89HiprTXyS8TKoaPlkKUjpuSHHlC9/PbFgoMAADfkfrnY27/gIK31t28vZKiMi9MnmOYTNfuezhj87e6X90WUWAAAPgOc4LdPm2BIzQ88WB24/kVZytc8qGzY1h9+F15yz+RhqH7yW0UBQYAgE9JPJjtCOtin/bqP+fXqfV7q+8Z6A5sVzLjNevhM7pf2qZRYAAA+JqCt9a5/QNSdxy73l6pO4+XPzFeCvHjqAkpu37Q/UBQYAAA+Bzz0eKqfkPKR4w1J9gTD+XYpy9yBwRW33t/1oZI3U/DP1BgAAD4oKxP/iKFKBv9nKNzV0enzgVvrJEul+5H4f9RYAAA+CBzgr1s9PNSiPNT5iZ9k6X7ObgRBQYAgI86d05m0V6tFAUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACgGgUGAACg2i0L7H8BMo1sGDYdtBIAAAAASUVORK5CYII=" alt="" />
十二、 插入表格:
@Test
public void createPDF_12() throws Exception {
Document doc = new Document();
PdfWriter.getInstance(doc, new FileOutputStream(new File("pdf/Linux12.pdf"))); // 将pdf文档写入文件
doc.open();
PdfPTable table = new PdfPTable(3);
PdfPCell cell1 = new PdfPCell(new Phrase("Cell 1"));
cell1.setUseBorderPadding(true);
//
// Setting cell's border width and color
//
cell1.setBorderWidth(5f);
cell1.setBorderColor(BaseColor.BLUE);
table.addCell(cell1); PdfPCell cell2 = new PdfPCell(new Phrase("Cell 2"));
cell2.setUseBorderPadding(true);
//
// Setting cell's background color
//
cell2.setBackgroundColor(BaseColor.GRAY);
//
// Setting cell's individual border color
//
cell2.setBorderWidthTop(1f);
cell2.setBorderColorTop(BaseColor.RED);
cell2.setBorderColorRight(BaseColor.GREEN);
cell2.setBorderColorBottom(BaseColor.BLUE);
cell2.setBorderColorLeft(BaseColor.BLACK);
table.addCell(cell2); PdfPCell cell3 = new PdfPCell(new Phrase("Cell 3"));
cell3.setUseBorderPadding(true);
//
// Setting cell's individual border width
//
cell3.setBorderWidthTop(2f);
cell3.setBorderWidthRight(1f);
cell3.setBorderWidthBottom(2f);
cell3.setBorderWidthLeft(1f);
table.addCell(cell3);
table.completeRow(); doc.add(table);
// 关闭pdf文档
doc.close();
}
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAzMAAAB9CAIAAAAZc6pgAAAO0UlEQVR4nO3da0wUd7/A8WGBdXeBOC1CQa1giGgqyFVThbpoL4hC27RUhI2tLSogWsHgBRZX9EXVFt9oG1tinlhfkFqfPlqx2KSP9mJIsRp9YpHWWOOl3qNAFQ7Q3T17Xuw5hMCyDAjLfzjfT35v2JuYzOx8mZ2dkeoBAAAgBmmkfwEAAAD8L8oMAABAFJQZAACAKCgzAAAAUVBmAAAAoqDMAAAARDGAMnMAAABgsCgzAAAAUVBmAAAAoqDMAAAAREGZAQAAiIIyAwAAEAVlBgAAIArKDAAAQBSUGQAAgCgoMwAAAFFQZgAAAKKgzAAAAERBmQEAAIiCMgMAABAFZQYAACAKygw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SUGQAAgCgoMwAAAFFQZgAAAKKgzAAAAERBmQEAAIiCMgMAABAFZQYAACAKygwAAEAUlBkAAIAoKDMAAABRUGYAAACioMwAAABEQZkBAACIgjIDAAAQBWUGAAAgCsoMAABAFJQZAACAKCgzAAAAUVBmAAAAoqDMAAAAREGZAQAAiIIyAwAAEAVlBgAAIArKDAAAQBSUGQAAgCgoMwAAAFFQZgAAAKKgzAAAAERBmQEAAIiCMgMAABAFZQYAACAKygwAAEAUlBkAAIAoKDMAAABRUGYAAACioMwAAABEoSS3/gfEra/jT65iigAAAABJRU5ErkJggg==" alt="" />
友情链接
- 测试的代码地址: http://pan.baidu.com/s/1kVwBDx9
Java三方---->pdf框架之IText的使用的更多相关文章
- Java三方---->excel框架之POI的使用一
Apache POI是Apache软件基金会的开放源码函式库,POI提供API给Java程序对Microsoft Office格式档案读和写的功能.pdf框架之IText的使用,参见我的博客:Java ...
- Java三方---->Thumbnailator框架的使用
Thumbnailator是一个用来生成图像缩略图的 Java类库,通过很简单的代码即可生成图片缩略图,也可直接对一整个目录的图片生成缩略图.有了它我们就不用在费心思使用Image I/O API,J ...
- java动态导出PDF(利用itext)
项目基于ssm框架,使用itext动态导出pdf文件: 1.引入两个jar包:itextpdf-5.5.5.jar.itext-asian-5.2.0.jar 说明: 1.itextpdf-5.5.5 ...
- 转 Java操作PDF之iText详细入门
转 Java操作PDF之iText详细入门 2016年08月08日 11:06:00 阅读数:19490 iText是著名的开放项目,是用于生成PDF文档的一个java类库.通过iText不仅可以生成 ...
- [itext]Java生成PDF文件
一.前言 最近在做也导出试卷的功能,刚开始是导出为doc,可是导出来格式都有变化,最后说直接将word转为pdf,可是各种不稳定,各种报错.最后想到直接将文件写入pdf(参考:http://www.c ...
- JAVA导出pdf实例
一.直接导出成PDF Java代码 1. import java.io.FileNotFoundException; 2. import java.io.FileOutputStream; 3. ...
- itextpdf JAVA 输出PDF文档
使用JAVA生成PDF的时候,还是有些注意事项需要处理的. 第一.中文问题,默认的itext是不支持中文的,想要支持,需要做些处理. 1.直接引用操作系统的中文字体库支持,由于此方案限制性强,又绑定了 ...
- 电子凭证 : Java 生成 Pdf
来源:蛙牛, my.oschina.net/lujianing/blog/894365 如有好文章投稿,请点击 → 这里了解详情 1.背景 在某些业务场景中,需要提供相关的电子凭证,比如网银/支付宝中 ...
- java三方---->dom4j解析xml数据
Dom4j是一个易用的.开源的库,用于XML,XPath和XSLT.它应用于Java平台,采用了Java集合框架并完全支持DOM,SAX和JAXP.今天我们就开始Dom4j的学习. Dom4j的使用 ...
随机推荐
- FusionCharts JavaScript API - Functions 常用方法整理笔记
FusionCharts JavaScript API - Functions Home > FusionCharts XT and JavaScript > API Reference ...
- Android各版本重要变动记录
本文来自同步博客. Android M:运行时权限 运行时权限属于比较熟悉的话题不深入展开.除了support包可以让应用完成运行时权限,github上也有好多扩展.用得比较多的是Google官方的E ...
- JSON对应的maven依赖包
常用有三种json解析jackson.fastjson.gson. jackson依赖包 <!-- https://mvnrepository.com/artifact/com.fasterxm ...
- js学习笔记14----DOM概念及子节点类型
1.概念 DOM:Document Object Model---文档对象模型 文档:html页面 文档对象:页面中的元素 文档对象模型:是一种定义,为了能够让程序(js)去操作页面中的元素. DOM ...
- C/C++,从未过时的编程语言之父
C/C++,持续火爆的编程语言之父 --訪传智播客C/C++学院院长传智·萧峰 编程语言作为实现互联网+基础必备工具,构建着互联网行业美轮美奂的大时代.作为编程语言之父--C语言,更是如鱼得水,在甘愿 ...
- pyqt的setObjectName()/findChild()
根据设置的Name标示查找组件的对象,关键函数:setObjectName()/findChild() findChild()/2:需要两个参数, 参数一:组件的类型,如QLineEdit.QPush ...
- 【Java集合的详细研究3】Arrays类常用方法
1.void sort(array)对数组array的元素进行升序排序 2.int binarySearch(array,val):查询元素值val在数组array中的下标 3.String toSt ...
- js实现密码强度
<!doctype html> <html> <head> <meta charset="utf-8"> <title> ...
- Ubuntu Server 下配置静态网络的方法
这几天一直在弄hadoop的集群,由于公司的网络原因,偶尔要重启路由器,如果网络是由路由器自动配置的话, 非常容易变换IP,这样的话,SSH无密码验证登陆到其他机器发送的配置文件*.pub就用不了,因 ...
- struts2 + spring3 + mybatis3 环境搭建
struts2 + spring3 + mybatis3 1. 框架下载 struts2: http://struts.apache.org/ 下载 struts-2.3.14-all.zip spr ...