|
@@ -72,12 +72,12 @@ public class PDFWrite_nohead_36 {
|
|
table = new PdfPTable(4);
|
|
table = new PdfPTable(4);
|
|
|
|
|
|
for (int i = 0; i < 4; i++) {
|
|
for (int i = 0; i < 4; i++) {
|
|
- PdfPTable pdfPTable4 = new PdfPTable(1);
|
|
|
|
- Font font = new Font(bfHei, 20);
|
|
|
|
|
|
+// PdfPTable pdfPTable4 = new PdfPTable(1);
|
|
|
|
+ Font font = new Font(bfHei, 18);
|
|
Paragraph bigPrice = new Paragraph("¥"+pdfGoodsDto.getPrice().substring(0,pdfGoodsDto.getPrice().indexOf(".")), font);
|
|
Paragraph bigPrice = new Paragraph("¥"+pdfGoodsDto.getPrice().substring(0,pdfGoodsDto.getPrice().indexOf(".")), font);
|
|
bigPrice.setAlignment(Element.ALIGN_BOTTOM);
|
|
bigPrice.setAlignment(Element.ALIGN_BOTTOM);
|
|
// --------------小价格-------------------------------
|
|
// --------------小价格-------------------------------
|
|
- font = new Font(bfHei, 10);
|
|
|
|
|
|
+ font = new Font(bfHei, 9);
|
|
Paragraph smallPrice = new Paragraph(pdfGoodsDto.getPrice().substring(pdfGoodsDto.getPrice().indexOf(".")), font);
|
|
Paragraph smallPrice = new Paragraph(pdfGoodsDto.getPrice().substring(pdfGoodsDto.getPrice().indexOf(".")), font);
|
|
smallPrice.setAlignment(Element.ALIGN_BOTTOM);
|
|
smallPrice.setAlignment(Element.ALIGN_BOTTOM);
|
|
smallPrice.setIndentationLeft(50);
|
|
smallPrice.setIndentationLeft(50);
|
|
@@ -87,15 +87,15 @@ public class PDFWrite_nohead_36 {
|
|
|
|
|
|
PdfPCell priceCell = new PdfPCell(bigPrice);
|
|
PdfPCell priceCell = new PdfPCell(bigPrice);
|
|
priceCell.setBorder(0);
|
|
priceCell.setBorder(0);
|
|
- priceCell.setHorizontalAlignment(Element.ALIGN_LEFT); // 水平居中
|
|
|
|
- priceCell.setVerticalAlignment(Element.ALIGN_BOTTOM); // 垂直居中
|
|
|
|
- priceCell.setPaddingRight(5f);
|
|
|
|
- pdfPTable4.addCell(priceCell);
|
|
|
|
|
|
+ priceCell.setHorizontalAlignment(Element.ALIGN_RIGHT); // 右边
|
|
|
|
+ priceCell.setVerticalAlignment(Element.ALIGN_BOTTOM); // 下面
|
|
|
|
+ priceCell.setPaddingRight(15f);
|
|
|
|
+// pdfPTable4.addCell(priceCell);
|
|
|
|
|
|
|
|
|
|
// ----------------test-----------------------
|
|
// ----------------test-----------------------
|
|
PdfPTable pdfPTable8 = new PdfPTable(2);
|
|
PdfPTable pdfPTable8 = new PdfPTable(2);
|
|
- pdfPTable8.setWidths(new int[]{10,8});
|
|
|
|
|
|
+ pdfPTable8.setWidths(new int[]{10,11});
|
|
font = new Font(bfHei, 6);
|
|
font = new Font(bfHei, 6);
|
|
// --------------左上的字-------------------------------
|
|
// --------------左上的字-------------------------------
|
|
Paragraph leftParagraph1 = new Paragraph("\n建议零售价省¥"+pdfGoodsDto.getSavings()+"\n\n", font);
|
|
Paragraph leftParagraph1 = new Paragraph("\n建议零售价省¥"+pdfGoodsDto.getSavings()+"\n\n", font);
|
|
@@ -111,7 +111,7 @@ public class PDFWrite_nohead_36 {
|
|
|
|
|
|
PdfPCell p = new PdfPCell(pdfPTable8);
|
|
PdfPCell p = new PdfPCell(pdfPTable8);
|
|
p.setBorder(0);
|
|
p.setBorder(0);
|
|
- table.setWidthPercentage(110f);
|
|
|
|
|
|
+ table.setWidthPercentage(112f);
|
|
table.addCell(p);
|
|
table.addCell(p);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -128,7 +128,7 @@ public class PDFWrite_nohead_36 {
|
|
Font font = new Font(bfHei, 5.5f);
|
|
Font font = new Font(bfHei, 5.5f);
|
|
font.setColor(Color.WHITE);
|
|
font.setColor(Color.WHITE);
|
|
Paragraph PLU = new Paragraph(pdfGoodsDto.getPlu(), font);
|
|
Paragraph PLU = new Paragraph(pdfGoodsDto.getPlu(), font);
|
|
- Paragraph blankParagraph = new Paragraph(" ", font);
|
|
|
|
|
|
+ Paragraph blankParagraph = new Paragraph(" ", font);
|
|
Paragraph barCode = new Paragraph(dtoBarCode.substring(dtoBarCode.length()-4), font);
|
|
Paragraph barCode = new Paragraph(dtoBarCode.substring(dtoBarCode.length()-4), font);
|
|
blankParagraph.add(barCode);
|
|
blankParagraph.add(barCode);
|
|
PLU.add(blankParagraph);
|
|
PLU.add(blankParagraph);
|
|
@@ -146,7 +146,7 @@ public class PDFWrite_nohead_36 {
|
|
img.setAlignment(Image.ALIGN_CENTER); //设置图片居中
|
|
img.setAlignment(Image.ALIGN_CENTER); //设置图片居中
|
|
img.setBorder(Image.NO_BORDER);
|
|
img.setBorder(Image.NO_BORDER);
|
|
img.setBorderColor(Color.WHITE);
|
|
img.setBorderColor(Color.WHITE);
|
|
- img.scaleAbsolute(72,10.5f);
|
|
|
|
|
|
+ img.scaleAbsolute(63,10.5f);
|
|
PdfPCell imgCell = new PdfPCell(img,false);
|
|
PdfPCell imgCell = new PdfPCell(img,false);
|
|
imgCell.setBorder(0);
|
|
imgCell.setBorder(0);
|
|
imgCell.setPaddingLeft(3f);
|
|
imgCell.setPaddingLeft(3f);
|
|
@@ -154,7 +154,7 @@ public class PDFWrite_nohead_36 {
|
|
pdfPTable7.addCell(imgCell);
|
|
pdfPTable7.addCell(imgCell);
|
|
PdfPCell p = new PdfPCell(pdfPTable7);
|
|
PdfPCell p = new PdfPCell(pdfPTable7);
|
|
p.setBorder(0);
|
|
p.setBorder(0);
|
|
- table.setWidthPercentage(110f);
|
|
|
|
|
|
+ table.setWidthPercentage(112f);
|
|
table.addCell(p);
|
|
table.addCell(p);
|
|
}
|
|
}
|
|
doc.add(table);
|
|
doc.add(table);
|
|
@@ -182,8 +182,9 @@ public class PDFWrite_nohead_36 {
|
|
Font font = new Font(bfHei, i2); // 设置字体
|
|
Font font = new Font(bfHei, i2); // 设置字体
|
|
Paragraph paragraph = new Paragraph(s, font); // 段落
|
|
Paragraph paragraph = new Paragraph(s, font); // 段落
|
|
PdfPCell nameCell = new PdfPCell(paragraph); // 单元Cell
|
|
PdfPCell nameCell = new PdfPCell(paragraph); // 单元Cell
|
|
|
|
+ nameCell.setPaddingRight(10f);
|
|
setBasisStyle(nameCell, Element.ALIGN_CENTER, Element.ALIGN_MIDDLE);
|
|
setBasisStyle(nameCell, Element.ALIGN_CENTER, Element.ALIGN_MIDDLE);
|
|
- table.setWidthPercentage(110f);
|
|
|
|
|
|
+ table.setWidthPercentage(112f);
|
|
table.addCell(nameCell);
|
|
table.addCell(nameCell);
|
|
}
|
|
}
|
|
|
|
|