Java生成PDF文件

最近项目中使用到Java实现导出PDF文件,经过一番参考研究最终决定使用itextpdf来实现,当然也可以参考 PDF Java类库:Spire.PDF for Java(https://www.e-iceblue.cn/spirepdfjava/create-pdf-in-java.html)。本文是使用第一种来实现的。

iText是著名的开放源码的站点sourceforge一个项目,是用于生成PDF文档的一个java类库。通过iText不仅可以生成PDF或rtf的文档,而且可以将XML、Html文件转化为PDF文件。
首先如果是maven项目的话需要添加2个依赖,普通项目的话在官网(http://itextpdf.com/)下载对应的2个jar包加入即可。LZ是maven项目,添加依赖如下:

  1.  <!-- https://mvnrepository.com/artifact/com.itextpdf/itextpdf -->
  2.     <dependency>
  3.       <groupId>com.itextpdf</groupId>
  4.       <artifactId>itextpdf</artifactId>
  5.       <version>5.5.13</version>
  6.     </dependency>
  7.     <!-- https://mvnrepository.com/artifact/com.itextpdf/itext-asian -->
  8.     <dependency>
  9.       <groupId>com.itextpdf</groupId>
  10.       <artifactId>itext-asian</artifactId>
  11.       <version>5.2.0</version>
  12. </dependency>

建立第一个PDF文档:
一、主要步骤(5个):

1.新建document对象,可通过一下三种任意一种
Document document =new Document(); // 默认页面大小是A4
Document document =new Document(PageSize.A4); // 指定页面大小为A4
Document document =new Document(PageSize.A4,50,50,30,20); // 指定页面大小为A4,且自定义页边距(marginLeft、marginRight、marginTop、marginBottom)
其中页面大小PageSize也可自定义大小,例:new Document(new Rectangle(400, 500));

2.建立一个书写器(Writer)与document对象关联,通过书写器(Writer)可以将文档写入到磁盘中。
创建 PdfWriter 对象 第一个参数是对文档对象的引用,第二个参数是文件的实际名称,在该名称中还会给出其输出路径
PdfWriter writer =PdfWriter.getInstance(document,new FileOutputStream(filePath));

3.打开文档
写入数据之前要打开文档
document.open();

4.向文档中添加内容
document.add();

5.关闭文档
document.close();
 

二、字体

新建一个字体,iText的方法
BaseFont bfChinese;
bfChinese=BaseFont.createFont("STSongStd-Light","UniGB-UCS2-H",BaseFont.NOT_EMBEDDED);//jar包
bfChinese=BaseFont.createFont("C:/Windows/Fonts/msyh.ttf",BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED); //系统字体,其实5.0版以后的iText加入字体还是很方便的。
STSongStd-Light 是字体,在jar 中以property为后缀
UniGB-UCS2-H 是编码,在jar 中以cmap为后缀
H 代表文字版式是横版,相应的 V 代表竖版

字体设置
参数一:新建好的字体;参数二:字体大小,参数三:字体样式,多个样式用“|”分隔
Font topfont = new Font(bfChinese,14,Font.BOLD);
Font textfont =new Font(bfChinese,10,,Font.BOLD|Font.UNDERLINE);
 

三、添加文本的对象:块、短句和段落

Chunk:块(Chunk)是能被添加到文档的文本的最小单位。
Phrase:短句(Phrase)是一系列以特定间距(两行之间的距离)作为参数的块。
Paragraph:段落是一系列块和(或)短句。同短句一样,段落有确定的间距。用户还可以指定缩排;在边和(或)右边保留一定空白,段落可以左对齐、右对齐和居中对齐。添加到文档中的每一个段落将自动另起一行。
 

四、步骤2书写器创建之后,步骤3文档打开之前
以下项只可在文档关闭状态执行 ,包括水印、页眉、页脚

水印
Watermark内部类,需要继承 PdfPageEventHelper类
writer.setPageEvent(new Watermark());

页眉/页脚
iText5中并没有之前版本HeaderFooter对象设置页眉和页脚,可以利用PdfPageEvent来完成页眉页脚的设置工作。
PdfPageEvent提供了几个pdf在创建时的事件,页眉页脚就是在每页加载完写入的。
每一页加个页码还是很简单的,但是总页码就麻烦了,iText是流模式的写入内容,只有写到最后,才能知道有多少页,那么显示总页数就麻烦了,不过麻烦不代表不可能。
其实iText仅在调用释放模板方法后才将PdfTemplate写入到OutputStream中,否则对象将一直保存在内存中,直到关闭文档。
所以我们可以在最后关闭文档前,使用PdfTemplate写入总页码。可以理解成先写个占位符,然后统一替换。
 

五、设置文档属性  (与文档是否打开没有关联)

document.addTitle("Title@PDF-Java");// 标题
document.addAuthor("Author@umiz");// 作者
document.addSubject("Subject@iText pdf sample");// 主题
document.addKeywords("Keywords@iTextpdf");// 关键字
document.addCreator("Creator@umiz`s");// 创建者
 

六、文档内容

段落Paragraph
Paragraph pt=new Paragraph(name,headfont);//设置字体样式
pt.setAlignment(1);//设置文字居中 0靠左   1,居中     2,靠右
pt.setIndentationLeft(12);// 左缩进  
pt.setIndentationRight(12);// 右缩进  
pt.setFirstLineIndent(24);// 首行缩进
paragraph.setLeading(20f); //行间距
paragraph.setSpacingBefore(5f); //设置段落上空白
paragraph.setSpacingAfter(10f); //设置段落下空白

表格table
Table table =new Table(3);//括号参数表示列
int width[] = {10,45,45};//设置每列宽度比例  
table.setWidths(width);  
table.setWidth(95);//占页面宽度比例
table.setAlignment(Element.ALIGN_CENTER);//居中   
table.setAutoFillEmptyCells(true);//自动填满      
table.setBorderWidth((float)0.1);//表格边框线条宽度   
table.setPadding(1);//边距:单元格的边线与单元格内容的边距  
table.setSpacing(0);//间距:单元格与单元格之间的距离
table.addCell(new Paragraph("name"),textfont));//添加单元格内容
table.endHeaders();//每页都会显示表头

单元格内容样式cell 
Cell cell=new Cell(new Paragraph("序号",keyfont));
cell.setHorizontalAlignment(Element.ALIGN_CENTER);//水平居中
cell.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直居中  
table.addCell(cell);

表格嵌套
  最外层表格
PdfPTable table =new PdfPTable(3);
table.setTotalWidth(300);
table.setLockedWidth(true);

PdfPCell cell;
cell =new PdfPCell(new Phrase("Table 5"));
cell.setColspan(3);
cell.setBorderWidth(0);//设置表格的边框宽度为0
table.addCell(cell);

  嵌套表格
PdfPTable celltable =new PdfPTable(2);
cell =new PdfPCell(celltable);
cell.setRowspan(2);
cell.setBorderWidth(1);//设置表格的边框宽度为1
cell.setPadding(10);//设置表格与上一个表格的填充为10
table.addCell(cell);

直线 
Paragraph p1 =new Paragraph();  
p1.add(new Chunk(new LineSeparator()));  
doc.add(p1); 

点线 
Paragraph p2 =new Paragraph();  
p2.add(new Chunk(new DottedLineSeparator()));

超链接
Anchor anchor =new Anchor("this is anchor");

定位
点击后,跳到topline的位置
Anchor gotop =new Anchor("go top");
gotop.setReference("#us");

添加图片
Image image =Image.getInstance(imgPath);
image.setAlignment(Image.ALIGN_CENTER);
image.scalePercent(40);//依照比例缩放

Demo

 

  1. package com.soco.erp;
  2.  
  3. import com.itextpdf.text.*;
  4. import com.itextpdf.text.pdf.*;
  5. import com.itextpdf.text.pdf.draw.DottedLineSeparator;
  6. import com.itextpdf.text.pdf.draw.LineSeparator;
  7.  
  8. import java.io.File;
  9. import java.io.FileOutputStream;
  10.  
  11. public class PdfReport {
  12.  
  13.     // main测试
  14.     public static void main(String[] args) throws Exception {
  15.         try {
  16.             // 1.新建document对象
  17.             Document document = new Document(PageSize.A4);// 建立一个Document对象
  18.  
  19.             // 2.建立一个书写器(Writer)与document对象关联
  20.             File file = new File("D:\\PDFDemo.pdf");
  21.             file.createNewFile();
  22.             PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(file));
  23.             writer.setPageEvent(new Watermark("HELLO ITEXTPDF"));// 水印
  24.             writer.setPageEvent(new MyHeaderFooter());// 页眉/页脚
  25.  
  26.             // 3.打开文档
  27.             document.open();
  28.             document.addTitle("Title@PDF-Java");// 标题
  29.             document.addAuthor("Author@umiz");// 作者
  30.             document.addSubject("Subject@iText pdf sample");// 主题
  31.             document.addKeywords("Keywords@iTextpdf");// 关键字
  32.             document.addCreator("Creator@umiz`s");// 创建者
  33.  
  34.             // 4.向文档中添加内容
  35.             new PdfReport().generatePDF(document);
  36.  
  37.             // 5.关闭文档
  38.             document.close();
  39.         } catch (Exception e) {
  40.             e.printStackTrace();
  41.         }
  42.     }
  43.  
  44.     // 定义全局的字体静态变量
  45.     private static Font titlefont;
  46.     private static Font headfont;
  47.     private static Font keyfont;
  48.     private static Font textfont;
  49.     // 最大宽度
  50.     private static int maxWidth = 520;
  51.     // 静态代码块
  52.     static {
  53.         try {
  54.             // 不同字体(这里定义为同一种字体:包含不同字号、不同style)
  55.             BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
  56.             titlefont = new Font(bfChinese, 16, Font.BOLD);
  57.             headfont = new Font(bfChinese, 14, Font.BOLD);
  58.             keyfont = new Font(bfChinese, 10, Font.BOLD);
  59.             textfont = new Font(bfChinese, 10, Font.NORMAL);
  60.  
  61.         } catch (Exception e) {
  62.             e.printStackTrace();
  63.         }
  64.     }
  65.  
  66.     // 生成PDF文件
  67.     public void generatePDF(Document document) throws Exception {
  68.  
  69.         // 段落
  70.         Paragraph paragraph = new Paragraph("美好的一天从早起开始!", titlefont);
  71.         paragraph.setAlignment(1); //设置文字居中 0靠左   1,居中     2,靠右
  72.         paragraph.setIndentationLeft(12); //设置左缩进
  73.         paragraph.setIndentationRight(12); //设置右缩进
  74.         paragraph.setFirstLineIndent(24); //设置首行缩进
  75.         paragraph.setLeading(20f); //行间距
  76.         paragraph.setSpacingBefore(5f); //设置段落上空白
  77.         paragraph.setSpacingAfter(10f); //设置段落下空白
  78.  
  79.         // 直线
  80.         Paragraph p1 = new Paragraph();
  81.         p1.add(new Chunk(new LineSeparator()));
  82.  
  83.         // 点线
  84.         Paragraph p2 = new Paragraph();
  85.         p2.add(new Chunk(new DottedLineSeparator()));
  86.  
  87.         // 超链接
  88.         Anchor anchor = new Anchor("baidu");
  89.         anchor.setReference("www.baidu.com");
  90.  
  91.         // 定位
  92.         Anchor gotoP = new Anchor("goto");
  93.         gotoP.setReference("#top");
  94.  
  95.         // 添加图片
  96.         Image image = Image.getInstance("https://img-blog.csdn.net/20180801174617455?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zNzg0ODcxMA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70");
  97.         image.setAlignment(Image.ALIGN_CENTER);
  98.         image.scalePercent(40); //依照比例缩放
  99.  
  100.         // 表格
  101.         PdfPTable table = createTable(new float[] { 40, 120, 120, 120, 80, 80 });
  102.         table.addCell(createCell("美好的一天", headfont, Element.ALIGN_LEFT, 6, false));
  103.         table.addCell(createCell("早上9:00", keyfont, Element.ALIGN_CENTER));
  104.         table.addCell(createCell("中午11:00", keyfont, Element.ALIGN_CENTER));
  105.         table.addCell(createCell("中午13:00", keyfont, Element.ALIGN_CENTER));
  106.         table.addCell(createCell("下午15:00", keyfont, Element.ALIGN_CENTER));
  107.         table.addCell(createCell("下午17:00", keyfont, Element.ALIGN_CENTER));
  108.         table.addCell(createCell("晚上19:00", keyfont, Element.ALIGN_CENTER));
  109.         Integer totalQuantity = 0;
  110.         for (int i = 0; i < 5; i++) {
  111.             table.addCell(createCell("起床", textfont));
  112.             table.addCell(createCell("吃午饭", textfont));
  113.             table.addCell(createCell("午休", textfont));
  114.             table.addCell(createCell("下午茶", textfont));
  115.             table.addCell(createCell("回家", textfont));
  116.             table.addCell(createCell("吃晚饭", textfont));
  117.             totalQuantity ++;
  118.         }
  119.         table.addCell(createCell("总计", keyfont));
  120.         table.addCell(createCell("", textfont));
  121.         table.addCell(createCell("", textfont));
  122.         table.addCell(createCell("", textfont));
  123.         table.addCell(createCell(String.valueOf(totalQuantity) + "件事", textfont));
  124.         table.addCell(createCell("", textfont));
  125.  
  126.         document.add(paragraph);
  127.         document.add(anchor);
  128.         document.add(p2);
  129.         document.add(gotoP);
  130.         document.add(p1);
  131.         document.add(table);
  132.         document.add(image);
  133.     }
  134.  
  135.  
  136. /**------------------------创建表格单元格的方法start----------------------------*/
  137.     /**
  138.      * 创建单元格(指定字体)
  139.      * @param value
  140.      * @param font
  141.      * @return
  142.      */
  143.     public PdfPCell createCell(String value, Font font) {
  144.         PdfPCell cell = new PdfPCell();
  145.         cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
  146.         cell.setHorizontalAlignment(Element.ALIGN_CENTER);
  147.         cell.setPhrase(new Phrase(value, font));
  148.         return cell;
  149.     }
  150.     /**
  151.      * 创建单元格(指定字体、水平..)
  152.      * @param value
  153.      * @param font
  154.      * @param align
  155.      * @return
  156.      */
  157.     public PdfPCell createCell(String value, Font font, int align) {
  158.         PdfPCell cell = new PdfPCell();
  159.         cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
  160.         cell.setHorizontalAlignment(align);
  161.         cell.setPhrase(new Phrase(value, font));
  162.         return cell;
  163.     }
  164.     /**
  165.      * 创建单元格(指定字体、水平居..、单元格跨x列合并)
  166.      * @param value
  167.      * @param font
  168.      * @param align
  169.      * @param colspan
  170.      * @return
  171.      */
  172.     public PdfPCell createCell(String value, Font font, int align, int colspan) {
  173.         PdfPCell cell = new PdfPCell();
  174.         cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
  175.         cell.setHorizontalAlignment(align);
  176.         cell.setColspan(colspan);
  177.         cell.setPhrase(new Phrase(value, font));
  178.         return cell;
  179.     }
  180.     /**
  181.      * 创建单元格(指定字体、水平居..、单元格跨x列合并、设置单元格内边距)
  182.      * @param value
  183.      * @param font
  184.      * @param align
  185.      * @param colspan
  186.      * @param boderFlag
  187.      * @return
  188.      */
  189.     public PdfPCell createCell(String value, Font font, int align, int colspan, boolean boderFlag) {
  190.         PdfPCell cell = new PdfPCell();
  191.         cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
  192.         cell.setHorizontalAlignment(align);
  193.         cell.setColspan(colspan);
  194.         cell.setPhrase(new Phrase(value, font));
  195.         cell.setPadding(3.0f);
  196.         if (!boderFlag) {
  197.             cell.setBorder(0);
  198.             cell.setPaddingTop(15.0f);
  199.             cell.setPaddingBottom(8.0f);
  200.         } else if (boderFlag) {
  201.             cell.setBorder(0);
  202.             cell.setPaddingTop(0.0f);
  203.             cell.setPaddingBottom(15.0f);
  204.         }
  205.         return cell;
  206.     }
  207.     /**
  208.      * 创建单元格(指定字体、水平..、边框宽度:0表示无边框、内边距)
  209.      * @param value
  210.      * @param font
  211.      * @param align
  212.      * @param borderWidth
  213.      * @param paddingSize
  214.      * @param flag
  215.      * @return
  216.      */
  217.     public PdfPCell createCell(String value, Font font, int align, float[] borderWidth, float[] paddingSize, boolean flag) {
  218.         PdfPCell cell = new PdfPCell();
  219.         cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
  220.         cell.setHorizontalAlignment(align);
  221.         cell.setPhrase(new Phrase(value, font));
  222.         cell.setBorderWidthLeft(borderWidth[0]);
  223.         cell.setBorderWidthRight(borderWidth[1]);
  224.         cell.setBorderWidthTop(borderWidth[2]);
  225.         cell.setBorderWidthBottom(borderWidth[3]);
  226.         cell.setPaddingTop(paddingSize[0]);
  227.         cell.setPaddingBottom(paddingSize[1]);
  228.         if (flag) {
  229.             cell.setColspan(2);
  230.         }
  231.         return cell;
  232.     }
  233. /**------------------------创建表格单元格的方法end----------------------------*/
  234.  
  235.  
  236. /**--------------------------创建表格的方法start------------------- ---------*/
  237.     /**
  238.      * 创建默认列宽,指定列数、水平(居中、右、左)的表格
  239.      * @param colNumber
  240.      * @param align
  241.      * @return
  242.      */
  243.     public PdfPTable createTable(int colNumber, int align) {
  244.         PdfPTable table = new PdfPTable(colNumber);
  245.         try {
  246.             table.setTotalWidth(maxWidth);
  247.             table.setLockedWidth(true);
  248.             table.setHorizontalAlignment(align);
  249.             table.getDefaultCell().setBorder(1);
  250.         } catch (Exception e) {
  251.             e.printStackTrace();
  252.         }
  253.         return table;
  254.     }
  255.     /**
  256.      * 创建指定列宽、列数的表格
  257.      * @param widths
  258.      * @return
  259.      */
  260.     public PdfPTable createTable(float[] widths) {
  261.         PdfPTable table = new PdfPTable(widths);
  262.         try {
  263.             table.setTotalWidth(maxWidth);
  264.             table.setLockedWidth(true);
  265.             table.setHorizontalAlignment(Element.ALIGN_CENTER);
  266.             table.getDefaultCell().setBorder(1);
  267.         } catch (Exception e) {
  268.             e.printStackTrace();
  269.         }
  270.         return table;
  271.     }
  272.     /**
  273.      * 创建空白的表格
  274.      * @return
  275.      */
  276.     public PdfPTable createBlankTable() {
  277.         PdfPTable table = new PdfPTable(1);
  278.         table.getDefaultCell().setBorder(0);
  279.         table.addCell(createCell("", keyfont));
  280.         table.setSpacingAfter(20.0f);
  281.         table.setSpacingBefore(20.0f);
  282.         return table;
  283.     }
  284. /**--------------------------创建表格的方法end------------------- ---------*/
  285. }

页眉/页脚的定义实现类:

 

  1. package com.soco.erp;
  2.  
  3. import com.itextpdf.text.*;
  4. import com.itextpdf.text.pdf.*;
  5.  
  6. import java.io.IOException;
  7.  
  8. public class MyHeaderFooter extends PdfPageEventHelper {
  9.     // 总页数
  10.     PdfTemplate totalPage;
  11.     Font hfFont;
  12.     {
  13.         try {
  14.             hfFont = new Font(BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED), 8, Font.NORMAL);
  15.         } catch (DocumentException e) {
  16.             e.printStackTrace();
  17.         } catch (IOException e) {
  18.             e.printStackTrace();
  19.         }
  20.     }
  21.  
  22.     // 打开文档时,创建一个总页数的模版
  23.     public void onOpenDocument(PdfWriter writer, Document document) {
  24.         PdfContentByte cb =writer.getDirectContent();
  25.         totalPage = cb.createTemplate(30, 16);
  26.     }
  27.     // 一页加载完成触发,写入页眉和页脚
  28.     public void onEndPage(PdfWriter writer, Document document) {
  29.         PdfPTable table = new PdfPTable(3);
  30.         try {
  31.             table.setTotalWidth(PageSize.A4.getWidth() - 100);
  32.             table.setWidths(new int[] { 24, 24, 3});
  33.             table.setLockedWidth(true);
  34.             table.getDefaultCell().setFixedHeight(-10);
  35.             table.getDefaultCell().setBorder(Rectangle.BOTTOM);
  36.  
  37.             table.addCell(new Paragraph("我是页眉/页脚", hfFont));// 可以直接使用addCell(str),不过不能指定字体,中文无法显示
  38.             table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
  39.             table.addCell(new Paragraph("第" + writer.getPageNumber() + "页/", hfFont));
  40.             // 总页数
  41.             PdfPCell cell = new PdfPCell(Image.getInstance(totalPage));
  42.             cell.setBorder(Rectangle.BOTTOM);
  43.             table.addCell(cell);
  44.             // 将页眉写到document中,位置可以指定,指定到下面就是页脚
  45.             table.writeSelectedRows(0, -1, 50,PageSize.A4.getHeight() - 20, writer.getDirectContent());
  46.         } catch (Exception de) {
  47.             throw new ExceptionConverter(de);
  48.         }
  49.     }
  50.  
  51.     // 全部完成后,将总页数的pdf模版写到指定位置
  52.     public void onCloseDocument(PdfWriter writer,Document document) {
  53.         String text = "总" + (writer.getPageNumber()) + "页";
  54.         ColumnText.showTextAligned(totalPage, Element.ALIGN_LEFT, new Paragraph(text,hfFont), 2, 2, 0);
  55.     }
  56.  
  57. }

加水印的实现类:

package com.soco.erp;
 
import com.itextpdf.text.Document;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.Phrase;
import com.itextpdf.text.pdf.ColumnText;
import com.itextpdf.text.pdf.GrayColor;
import com.itextpdf.text.pdf.PdfPageEventHelper;
import com.itextpdf.text.pdf.PdfWriter;
 
public class Watermark extends PdfPageEventHelper {
    Font FONT = new Font(Font.FontFamily.HELVETICA, 30, Font.BOLD, new GrayColor(0.95f));
    private String waterCont;//水印内容
    public Watermark() {
 
    }
    public Watermark(String waterCont) {
        this.waterCont = waterCont;
    }
 
    @Override
    public void onEndPage(PdfWriter writer, Document document) {
        for(int i=0 ; i<5; i++) {
            for(int j=0; j<5; j++) {
                ColumnText.showTextAligned(writer.getDirectContentUnder(),
                        Element.ALIGN_CENTER,
                        new Phrase(this.waterCont == null ? "HELLO WORLD" : this.waterCont, FONT),
                        (50.5f+i*350),
                        (40.0f+j*150),
                        writer.getPageNumber() % 2 == 1 ? 45 : -45);
            }
        }
    }

}

  • 1
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值