Git Product home page Git Product logo

Comments (10)

TimRazumov avatar TimRazumov commented on July 23, 2024

error in version v0.0.0-20210316172528-f0a07eb93909, which also leads to a fall. occurs less frequently than the previous error in latest version

uncaught error: invalid key in dict

from go-fitz.

gen2brain avatar gen2brain commented on July 23, 2024

Does that happen with all documents or you have only some that are problematic? In bindings, errors are not "caught", if that is something internal to mupdf I cannot help.

from go-fitz.

TimRazumov avatar TimRazumov commented on July 23, 2024

https://github.com/ArtifexSoftware/mupdf/blob/master/source/pdf/pdf-xref.c#L2280
https://github.com/ArtifexSoftware/mupdf/blob/master/source/fitz/error.c#L153

from go-fitz.

TimRazumov avatar TimRazumov commented on July 23, 2024

in doc mupdf. it seems your wrapper doesn't have this processing.
will it be difficult for you to add this?

All functions you call should be guarded by a fz_try block to catch the errors, or the program will call exit() on errors. You don't want that.

image

from go-fitz.

TimRazumov avatar TimRazumov commented on July 23, 2024

Hello. have any ideas how you can fix this?

from go-fitz.

gen2brain avatar gen2brain commented on July 23, 2024

I was not able to reproduce with files I usually use for testing. I don't have time to mess with this currently, also, if you or someone else can fix this, I accept PRs.

from go-fitz.

diegobernardes avatar diegobernardes commented on July 23, 2024

I think the only way of solving this problem is using Go as a simple glue layer instead of directly interacting with the library. I don't think it's possible at all to use MuPDF try/catch mechanism directly with Go.

I've been working on a wrapper of MuPDF with Go that is very specific for the company that I'm working for, but it may give some ideas: https://github.com/nitro/lazypdf

from go-fitz.

TimRazumov avatar TimRazumov commented on July 23, 2024

hello @diegobernardes. I saw your library, but it's not entirely clear to me how to install it, which I described in this issue: Nitro/lazypdf#51

from go-fitz.

gen2brain avatar gen2brain commented on July 23, 2024

Closing this in favor of #57.

from go-fitz.

gen2brain avatar gen2brain commented on July 23, 2024

This should be fixed in f15918d.

from go-fitz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.