add new feature to set progress callback

This commit is contained in:
Adrian Zürcher
2025-12-25 01:14:03 +01:00
parent edb8d7e830
commit 613b74ee55
2 changed files with 15 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
package html2pdf
import (
"fmt"
"os"
"path/filepath"
"strings"
@@ -46,6 +47,10 @@ func TestConvertFiles(t *testing.T) {
t.Fatal(err)
}
c.SetProgressCallback(func(progress int) {
fmt.Println(progress)
})
if err := c.Convert(input...); err != nil {
t.Fatal(err)
}