|
@@ -46,7 +46,11 @@ public class PDFWrite {
|
|
// --------------产品名称-------------------------------
|
|
// --------------产品名称-------------------------------
|
|
PdfPTable pdfPTable2 = new PdfPTable(1);
|
|
PdfPTable pdfPTable2 = new PdfPTable(1);
|
|
Font font = new Font(bfHei, 60);
|
|
Font font = new Font(bfHei, 60);
|
|
|
|
+ if (pdfGoodsDto.getProductName().length()>30){
|
|
|
|
+ font = new Font(bfHei,30);
|
|
|
|
+ }
|
|
Paragraph tParagraph = new Paragraph(pdfGoodsDto.getProductName(), font);
|
|
Paragraph tParagraph = new Paragraph(pdfGoodsDto.getProductName(), font);
|
|
|
|
+
|
|
PdfPCell nameCell = new PdfPCell(tParagraph);
|
|
PdfPCell nameCell = new PdfPCell(tParagraph);
|
|
nameCell.setBorder(0);
|
|
nameCell.setBorder(0);
|
|
nameCell.setHorizontalAlignment(Element.ALIGN_CENTER); // 水平居中
|
|
nameCell.setHorizontalAlignment(Element.ALIGN_CENTER); // 水平居中
|
|
@@ -60,6 +64,9 @@ public class PDFWrite {
|
|
// --------------产品英文名称-------------------------------
|
|
// --------------产品英文名称-------------------------------
|
|
PdfPTable pdfPTable3 = new PdfPTable(1);
|
|
PdfPTable pdfPTable3 = new PdfPTable(1);
|
|
font = new Font(bfHei, 30);
|
|
font = new Font(bfHei, 30);
|
|
|
|
+ if (pdfGoodsDto.getEnglishName().length()>50){
|
|
|
|
+ font = new Font(bfHei,15);
|
|
|
|
+ }
|
|
Paragraph englistPararaph = new Paragraph(pdfGoodsDto.getEnglishName(), font);
|
|
Paragraph englistPararaph = new Paragraph(pdfGoodsDto.getEnglishName(), font);
|
|
PdfPCell englishNameCell = new PdfPCell(englistPararaph);
|
|
PdfPCell englishNameCell = new PdfPCell(englistPararaph);
|
|
englishNameCell.setBorder(0);
|
|
englishNameCell.setBorder(0);
|