mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 01:27:26 +08:00
1 parent
d9046af3b0
commit
ecf221c1c0
12 files changed
+1222
-30
No files matched your search
+9
-2
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user