feat(转换能力): 新增批量转换功能
build.yaml / build (push) Successful in 41s

This commit is contained in:
xiaoqidun committed 2026-09-26 13:39:15 +08:00
1 parent d9046af3b0
commit ecf221c1c0
12 files changed
+1222 -30

No files matched your search

+9 -2
View File
@@ -197,11 +197,18 @@ func ConvertPDF(ctx context.Context, source io.ReaderAt, size int64, output io.W
if err := options.OnProgress("write", 0, 0); err != nil {
return PDFImportReport{}, err
}
editor.OnWriteProgress = func(stage string, completed, total int) error {
}
editor.OnWriteProgress = func(stage string, completed, total int) error {
if err := ctx.Err(); err != nil {
return err
}
if options.OnProgress != nil {
return options.OnProgress("write."+stage, completed, total)
}
return nil
}
_, err = editor.WriteTo(output)
var written int64
_, err = editor.WriteTo(convertWriter{context: ctx, writer: output, count: &written})
return report, err
}