This commit is contained in:
@@ -637,14 +637,10 @@ func (pb *PageBuilder) addHeader(pdf *gofpdf.Fpdf, chineseFontAvailable bool) {
|
||||
// 绘制logo(如果存在)
|
||||
if pb.logoPath != "" {
|
||||
if _, err := os.Stat(pb.logoPath); err == nil {
|
||||
// gofpdf的ImageOptions方法(调整位置和大小,左边距是15mm)
|
||||
pdf.ImageOptions(pb.logoPath, 15, 5, 15, 15, false, gofpdf.ImageOptions{}, 0, "")
|
||||
pb.logger.Info("已添加logo", zap.String("path", pb.logoPath))
|
||||
} else {
|
||||
pb.logger.Warn("logo文件不存在", zap.String("path", pb.logoPath), zap.Error(err))
|
||||
pb.logger.Warn("logo文件不存在", zap.String("path", pb.logoPath))
|
||||
}
|
||||
} else {
|
||||
pb.logger.Warn("logo路径为空")
|
||||
}
|
||||
|
||||
// 绘制"天远数据"文字(使用中文字体如果可用)
|
||||
|
||||
Reference in New Issue
Block a user