|
@@ -34,7 +34,7 @@ public class PDFWrite_nohead_36 {
|
|
|
|
|
|
writer.setPdfVersion(PdfWriter.PDF_VERSION_1_2);//版本(默认1.4)
|
|
writer.setPdfVersion(PdfWriter.PDF_VERSION_1_2);//版本(默认1.4)
|
|
doc.open();// 打开文档
|
|
doc.open();// 打开文档
|
|
- doc.setMargins(0,0,0,0);
|
|
|
|
|
|
+ doc.setMargins(0,0,-20,0);
|
|
|
|
|
|
// -----------------------标签头----------------------
|
|
// -----------------------标签头----------------------
|
|
for (int i = 0; i < 9; i++) {
|
|
for (int i = 0; i < 9; i++) {
|
|
@@ -89,6 +89,7 @@ public class PDFWrite_nohead_36 {
|
|
priceCell.setBorder(0);
|
|
priceCell.setBorder(0);
|
|
priceCell.setHorizontalAlignment(Element.ALIGN_LEFT); // 水平居中
|
|
priceCell.setHorizontalAlignment(Element.ALIGN_LEFT); // 水平居中
|
|
priceCell.setVerticalAlignment(Element.ALIGN_BOTTOM); // 垂直居中
|
|
priceCell.setVerticalAlignment(Element.ALIGN_BOTTOM); // 垂直居中
|
|
|
|
+ priceCell.setPaddingRight(5f);
|
|
pdfPTable4.addCell(priceCell);
|
|
pdfPTable4.addCell(priceCell);
|
|
|
|
|
|
|
|
|
|
@@ -123,10 +124,11 @@ public class PDFWrite_nohead_36 {
|
|
for (int i = 0; i < 4; i++) {
|
|
for (int i = 0; i < 4; i++) {
|
|
// --------------底部黑色和条形码区域-------------------------------
|
|
// --------------底部黑色和条形码区域-------------------------------
|
|
PdfPTable pdfPTable7 = new PdfPTable(2);
|
|
PdfPTable pdfPTable7 = new PdfPTable(2);
|
|
|
|
+ pdfPTable7.setWidths(new int[]{8,10});
|
|
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);
|
|
@@ -147,6 +149,7 @@ public class PDFWrite_nohead_36 {
|
|
img.scaleAbsolute(72,10.5f);
|
|
img.scaleAbsolute(72,10.5f);
|
|
PdfPCell imgCell = new PdfPCell(img,false);
|
|
PdfPCell imgCell = new PdfPCell(img,false);
|
|
imgCell.setBorder(0);
|
|
imgCell.setBorder(0);
|
|
|
|
+ imgCell.setPaddingLeft(3f);
|
|
pdfPTable7.addCell(pluCell);
|
|
pdfPTable7.addCell(pluCell);
|
|
pdfPTable7.addCell(imgCell);
|
|
pdfPTable7.addCell(imgCell);
|
|
PdfPCell p = new PdfPCell(pdfPTable7);
|
|
PdfPCell p = new PdfPCell(pdfPTable7);
|