fix: 🐛 disable config loading to allow pdfcpu usage in web

This commit is contained in:
RaviAnand Mohabir 2025-03-25 18:37:21 +01:00
parent 93ef9edd15
commit f674524aea

View File

@ -13,6 +13,7 @@ import (
"syscall/js" "syscall/js"
pdfcpu "github.com/pdfcpu/pdfcpu/pkg/api" pdfcpu "github.com/pdfcpu/pdfcpu/pkg/api"
"github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model"
) )
type Customer struct { type Customer struct {
@ -129,6 +130,10 @@ func createArchive(this js.Value, args []js.Value) any {
return promiseConstructor.New(handler) return promiseConstructor.New(handler)
} }
func init() {
model.ConfigPath = "disable"
}
func main() { func main() {
c := make(chan struct{}, 0) c := make(chan struct{}, 0)
js.Global().Set("createArchive", js.FuncOf(createArchive)) js.Global().Set("createArchive", js.FuncOf(createArchive))