|
@@ -15,7 +15,7 @@ public class PDFWrite_36 {
|
|
|
|
|
|
|
|
|
public void write(Document doc, PdfWriter writer, PDFGoodsDto pdfGoodsDto
|
|
|
- , String fontUrl, String uploadDir, String headUrl) throws IOException, DocumentException {
|
|
|
+ , String fontUrl, String uploadDir, String headUrl,String isPrintRate) throws IOException, DocumentException {
|
|
|
|
|
|
// 设置字体
|
|
|
BaseFont bfHei = BaseFont.createFont(fontUrl,BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED);
|
|
@@ -30,19 +30,20 @@ public class PDFWrite_36 {
|
|
|
doc.open();// 打开文档
|
|
|
|
|
|
// -----------------------标签头----------------------
|
|
|
- getPdfPTable(FontChinese11, bfHei, doc,pdfGoodsDto,headUrl);
|
|
|
- getPdfPTable(FontChinese11, bfHei, doc,pdfGoodsDto,headUrl);
|
|
|
- getPdfPTable(FontChinese11, bfHei, doc,pdfGoodsDto,headUrl);
|
|
|
- getPdfPTable(FontChinese11, bfHei, doc,pdfGoodsDto,headUrl);
|
|
|
- getPdfPTable(FontChinese11, bfHei, doc,pdfGoodsDto,headUrl);
|
|
|
- getPdfPTable(FontChinese11, bfHei, doc,pdfGoodsDto,headUrl);
|
|
|
+ getPdfPTable(FontChinese11, bfHei, doc,pdfGoodsDto,headUrl,isPrintRate);
|
|
|
+ getPdfPTable(FontChinese11, bfHei, doc,pdfGoodsDto,headUrl,isPrintRate);
|
|
|
+ getPdfPTable(FontChinese11, bfHei, doc,pdfGoodsDto,headUrl,isPrintRate);
|
|
|
+ getPdfPTable(FontChinese11, bfHei, doc,pdfGoodsDto,headUrl,isPrintRate);
|
|
|
+ getPdfPTable(FontChinese11, bfHei, doc,pdfGoodsDto,headUrl,isPrintRate);
|
|
|
+ getPdfPTable(FontChinese11, bfHei, doc,pdfGoodsDto,headUrl,isPrintRate);
|
|
|
|
|
|
|
|
|
doc.close(); //记得关闭document
|
|
|
|
|
|
}
|
|
|
|
|
|
- private static void getPdfPTable(Font fontChinese11, BaseFont bfHei, Document doc, PDFGoodsDto pdfGoodsDto,String headUrl) throws IOException, DocumentException {
|
|
|
+ private static void getPdfPTable(Font fontChinese11, BaseFont bfHei, Document doc, PDFGoodsDto pdfGoodsDto,
|
|
|
+ String headUrl,String isPrintRate) throws IOException, DocumentException {
|
|
|
PdfPTable table = new PdfPTable(3);
|
|
|
table = new PdfPTable(6);
|
|
|
|
|
@@ -161,11 +162,14 @@ public class PDFWrite_36 {
|
|
|
|
|
|
|
|
|
// --------------底部2-------------------------------
|
|
|
- table = new PdfPTable(6);
|
|
|
- for (int i = 0; i < 6; i++) {
|
|
|
- setTable(bfHei, table, 6, "税率:"+pdfGoodsDto.getStartFax());
|
|
|
+ if ("1".equals(isPrintRate)){
|
|
|
+ table = new PdfPTable(6);
|
|
|
+ for (int i = 0; i < 6; i++) {
|
|
|
+ setTable(bfHei, table, 6, "税率:"+pdfGoodsDto.getStartFax());
|
|
|
+ }
|
|
|
+ doc.add(table);
|
|
|
+
|
|
|
}
|
|
|
- doc.add(table);
|
|
|
|
|
|
|
|
|
table = new PdfPTable(6);
|