gen2brain / go-fitz

Golang wrapper for the MuPDF Fitz library
GNU Affero General Public License v3.0
412 stars 96 forks source link

outline.page.page undefined (type _Ctype_int has no field or method page) compiler (MissingFieldOrMethod) #84

Closed bhambrah-asbuilt closed 1 year ago

bhambrah-asbuilt commented 1 year ago

getting error in this line: https://github.com/gen2brain/go-fitz/blob/master/fitz.go#L499 outline.page.page undefined (type _Ctype_int has no field or method page) compiler (MissingFieldOrMethod)

using github.com/gen2brain/go-fitz v1.22.2 on Ubuntu 22.04.2 LTS go version go1.19.3 linux/amd64

gen2brain commented 1 year ago

It is not clear, are you trying to use an external library? If that is the case either install the latest mupdf version or use the older version of go-fitz.

bhambrah-asbuilt commented 1 year ago

It is not clear, are you trying to use an external library? If that is the case either install the latest mupdf version or use the older version of go-fitz.

@gen2brain i am trying to use go-fitz to convert a pdf to png. however, after installing it by running go get command and using it in my code, i run into this error.

the error gets highlighted in VSCode and my docker build fails because it gives the error undefined: fitz.New most probably because of the compilation error.

bhambrah-asbuilt commented 1 year ago

ksnip_20230608-211653

gen2brain commented 1 year ago

Sure, and go-fitz is a wrapper for MuPDF, it comes with bundled library without CJK fonts or the user can use the full external library via tags. So, it is important to know how are you "trying to use" the library. As you can see it is tested and is working on Ubuntu, macOS, and Windows and it works. It looks like an API change in MuPDF that happened around version 1.14, so you are using an external library and some old external version?

bhambrah-asbuilt commented 1 year ago

Sure, and go-fitz is a wrapper for MuPDF, it comes with bundled library without CJK fonts or the user can use the full external library via tags. So, it is important to know how are you "trying to use" the library. As you can see it is tested and is working on Ubuntu, macOS, and Windows and it works. It looks like an API change in MuPDF that happened around version 1.14, so you are using an external library and some old external version?

@gen2brain sorry for my lack of knowledge here. I understand it is tested and works on different platforms; just that i haven't been able to use it in my code. are there any prerequisites to be able to use it? i have already installed latest version of mupdf using apt-get and then i am installing go-fitz (go get github.com/gen2brain/go-fitz), running go mod vendor and using in my code.

closing the issue, but any help will be appreciated.

gen2brain commented 1 year ago

What is the version of mupdf you are using? Do you have a need to use external library at all?