Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f658cf32
由
LN
编写于
2025-06-19 17:10:03 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
二维码打印修改。
1 个父辈
eaa8af9e
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
14 行增加
和
7 行删除
src/main/java/com/neotel/smfcore/core/barcode/utils/QrcodeUtils.java
src/main/java/com/neotel/smfcore/core/barcode/utils/QrcodeUtils.java
查看文件 @
f658cf3
...
@@ -77,6 +77,7 @@ public class QrcodeUtils {
...
@@ -77,6 +77,7 @@ public class QrcodeUtils {
codeSize
=
codeSize
-
pageSpace
*
2
;
codeSize
=
codeSize
-
pageSpace
*
2
;
int
fontSize
=
settings
.
getFontSize
();
int
fontSize
=
settings
.
getFontSize
();
fontSize
=
24
;
int
index
=
0
;
int
index
=
0
;
// 生成二维码图片
// 生成二维码图片
...
@@ -108,10 +109,14 @@ public class QrcodeUtils {
...
@@ -108,10 +109,14 @@ public class QrcodeUtils {
BaseFont
baseFont
=
BaseFont
.
createFont
(
"C:/WINDOWS/Fonts/simsun.ttc,1"
,
BaseFont
.
IDENTITY_H
,
BaseFont
.
NOT_EMBEDDED
);
BaseFont
baseFont
=
BaseFont
.
createFont
(
"C:/WINDOWS/Fonts/simsun.ttc,1"
,
BaseFont
.
IDENTITY_H
,
BaseFont
.
NOT_EMBEDDED
);
boldFont
=
new
Font
(
baseFont
,
fontSize
);
boldFont
=
new
Font
(
baseFont
,
fontSize
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
log
.
error
(
"未找到字体simsun.ttc"
);
log
.
error
(
"未找到字体simsun.ttc,使用默认字体"
);
// 使用默认字体,但增大字体大小
boldFont
=
new
Font
(
Font
.
BOLD
,
fontSize
+
2
);
}
}
PdfPTable
table
=
new
PdfPTable
(
2
);
// PdfPTable table = new PdfPTable(2);
PdfPTable
table
=
new
PdfPTable
(
1
);
table
.
getDefaultCell
().
setVerticalAlignment
(
Element
.
ALIGN_CENTER
);
table
.
getDefaultCell
().
setVerticalAlignment
(
Element
.
ALIGN_CENTER
);
if
(
baseColumnCount
==
2
){
if
(
baseColumnCount
==
2
){
table
.
getDefaultCell
().
setMinimumHeight
(
codeSize
/
4.3f
);
table
.
getDefaultCell
().
setMinimumHeight
(
codeSize
/
4.3f
);
...
@@ -119,10 +124,12 @@ public class QrcodeUtils {
...
@@ -119,10 +124,12 @@ public class QrcodeUtils {
table
.
setSpacingBefore
(
15
);
table
.
setSpacingBefore
(
15
);
}
}
float
[]
columnWidths
=
{
0.6f
,
1
f
};
// float[] columnWidths = { 0.6f, 1f};
float
[]
columnWidths
=
{
1
f
};
table
.
setWidths
(
columnWidths
);
table
.
setWidths
(
columnWidths
);
table
.
addCell
(
new
Phrase
(
"Reel ID:"
,
boldFont
));
//
table.addCell(new Phrase("Reel ID:", boldFont));
table
.
addCell
(
new
Phrase
(
qrcodeContent
,
boldFont
));
table
.
addCell
(
new
Phrase
(
qrcodeContent
,
boldFont
));
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
qrcodeContent
);
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
qrcodeContent
);
...
@@ -136,14 +143,14 @@ public class QrcodeUtils {
...
@@ -136,14 +143,14 @@ public class QrcodeUtils {
desc
=
barcode
.
getMemo
();
desc
=
barcode
.
getMemo
();
}
}
table
.
addCell
(
new
Phrase
(
"PN:"
,
boldFont
));
//
table.addCell(new Phrase("PN:", boldFont));
table
.
addCell
(
new
Phrase
(
partNumber
,
boldFont
));
table
.
addCell
(
new
Phrase
(
partNumber
,
boldFont
));
table
.
addCell
(
new
Phrase
(
"QTY:"
,
boldFont
));
//
table.addCell(new Phrase("QTY:",boldFont));
table
.
addCell
(
new
Phrase
(
qty
,
boldFont
));
table
.
addCell
(
new
Phrase
(
qty
,
boldFont
));
table
.
addCell
(
new
Phrase
(
"DESC:"
,
boldFont
));
//
table.addCell(new Phrase("DESC:",boldFont));
table
.
addCell
(
new
Phrase
(
desc
,
boldFont
));
table
.
addCell
(
new
Phrase
(
desc
,
boldFont
));
// Paragraph paragraph = new Paragraph(textContent,font);
// Paragraph paragraph = new Paragraph(textContent,font);
// paragraph.setAlignment(Element.ALIGN_LEFT);
// paragraph.setAlignment(Element.ALIGN_LEFT);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论