-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add windows impl * fix gnu specific flag --parents * CI: fix shell directive * CI: add current go version, add wget on Windows * CI: fix windows * CI: fix windows; use curl in downloader script is available * add lib extension to extracted file to make it work on windows * reenable CI for all platforms * Close extracted lib before deleting * fix wget param in downloader script * update README
- Loading branch information
Showing
16 changed files
with
119 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package pdflibwrappers | ||
|
||
import ( | ||
"errors" | ||
"syscall" | ||
) | ||
|
||
var CloseLib func() = func() {} | ||
|
||
// TryLoadLib tries to load a shared object/dynamically linked library | ||
// from various paths and returns a handle or 0 and an error. | ||
func TryLoadLib(paths ...string) (uintptr, string, error) { | ||
var lib syscall.Handle | ||
var liberr, err error | ||
for _, path := range paths { | ||
lib, liberr = syscall.LoadLibrary(path) | ||
err = errors.Join(liberr, err) | ||
if lib != 0 { | ||
CloseLib = func() { | ||
syscall.FreeLibrary(syscall.Handle(lib)) | ||
} | ||
return uintptr(lib), path, nil | ||
} | ||
} | ||
return 0, "", err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//go:build embed_pdfium | ||
|
||
package pdfium_purego | ||
|
||
import ( | ||
_ "embed" | ||
) | ||
|
||
var ( | ||
//go:embed lib/pdfium.dll | ||
pdfiumBlob []byte | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package pdfium_purego | ||
|
||
var defaultLibNames = []string{"libpdfium.dylib"} | ||
|
||
const libExtension string = ".dylib" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package pdfium_purego | ||
|
||
var defaultLibNames = []string{"libpdfium.so", "/usr/lib/libreoffice/program/libpdfiumlo.so"} | ||
|
||
const libExtension string = ".so" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package pdfium_purego | ||
|
||
var defaultLibNames = []string{"pdfium.dll"} | ||
|
||
const libExtension string = ".dll" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters