style(代码风格): 整理声明顺序与字体模块
build.yaml / build (push) Successful in 51s

This commit is contained in:
xiaoqidun committed 2026-09-28 15:17:45 +08:00
1 parent 5e0da3da28
commit ee6c9f6a16
82 files changed
+4316 -4310

No files matched your search

+13 -13
View File
@@ -204,19 +204,6 @@ func ImportPDF(ctx context.Context, source io.ReaderAt, size int64, options PDFI
return editor, importer.report, nil
}
// commitObjects 将当前页面待转换对象写入编辑文档
// 返回: error 对象写入错误
func (p *pdfImporter) commitObjects() error {
if len(p.objects) == 0 {
return nil
}
if _, err := p.editor.CopyObjects(p.page, p.objects, 0, 0); err != nil {
return err
}
p.objects = nil
return nil
}
// ConvertPDF 将PDF转换并写入OFD,转换阶段失败时不写入目标
// 入参: ctx 取消上下文, source PDF数据, size 字节数, output OFD输出, options 转换选项
// 返回: PDFImportReport 转换统计, error 错误信息
@@ -247,6 +234,19 @@ func ConvertPDF(ctx context.Context, source io.ReaderAt, size int64, output io.W
return report, err
}
// commitObjects 将当前页面待转换对象写入编辑文档
// 返回: error 对象写入错误
func (p *pdfImporter) commitObjects() error {
if len(p.objects) == 0 {
return nil
}
if _, err := p.editor.CopyObjects(p.page, p.objects, 0, 0); err != nil {
return err
}
p.objects = nil
return nil
}
// pdfPageMatrix 将裁剪框、用户单位及页面旋转转换为OFD毫米坐标
// 入参: page PDF页面
// 返回: pdfgo.Matrix 坐标变换, float64 页面宽度, float64 页面高度