File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 7
7
"io"
8
8
"os"
9
9
"path/filepath"
10
+ "strconv"
11
+ "strings"
10
12
"sync"
11
13
"unsafe"
12
14
@@ -623,6 +625,33 @@ func init() {
623
625
purego .RegisterLibFunc (& fzPrintStextPageAsHTML , libmupdf , "fz_print_stext_page_as_html" )
624
626
purego .RegisterLibFunc (& fzPrintStextHeaderAsHTML , libmupdf , "fz_print_stext_header_as_html" )
625
627
purego .RegisterLibFunc (& fzPrintStextTrailerAsHTML , libmupdf , "fz_print_stext_trailer_as_html" )
628
+
629
+ ver := version ()
630
+ if ver != "" {
631
+ FzVersion = ver
632
+ }
633
+ }
634
+
635
+ func version () string {
636
+ if fzNewContextImp (nil , nil , uint64 (MaxStore ), FzVersion ) != nil {
637
+ return FzVersion
638
+ }
639
+
640
+ s := strings .Split (FzVersion , "." )
641
+ v := strings .Join (s [:len (s )- 1 ], "." )
642
+
643
+ for x := 10 ; x >= 0 ; x -- {
644
+ ver := v + "." + strconv .Itoa (x )
645
+ if ver == FzVersion {
646
+ continue
647
+ }
648
+
649
+ if fzNewContextImp (nil , nil , uint64 (MaxStore ), ver ) != nil {
650
+ return ver
651
+ }
652
+ }
653
+
654
+ return ""
626
655
}
627
656
628
657
type bundle struct {
You can’t perform that action at this time.
0 commit comments