Giter Club home page Giter Club logo

Comments (6)

rorycl avatar rorycl commented on September 4, 2024

Although gofpdi has improved, there are still issues.

from rm2pdf.

rorycl avatar rorycl commented on September 4, 2024

Some pdf files still cause errors, unfortunately.

from rm2pdf.

diegotsutsumi avatar diegotsutsumi commented on September 4, 2024

I'm adding another sample of the error with the attached zip file if it helps your debugging.

panic: Failed to initialize parser: Failed to read pdf: Failed to read xref table: Unsupported /DecodeParms - only tested with /Columns <= 4 and /Predictor <= 12

goroutine 1 [running]:
github.com/phpdave11/gofpdi.(*Importer).SetSourceStream(0xc0000c5140, 0xc0000c0540)
	/home/tsutsumi/go/pkg/mod/github.com/phpdave11/[email protected]/importer.go:95 +0x19b
github.com/jung-kurt/gofpdf/contrib/gofpdi.(*Importer).ImportPageFromStream(0x75bba8, {0x647248, 0xc00011d000}, 0x3?, 0x3?, {0x5fe5f8, 0x9})
	/home/tsutsumi/go/pkg/mod/github.com/jung-kurt/[email protected]/contrib/gofpdi/gofpdi.go:54 +0x45
github.com/jung-kurt/gofpdf/contrib/gofpdi.ImportPageFromStream(...)
	/home/tsutsumi/go/pkg/mod/github.com/jung-kurt/[email protected]/contrib/gofpdi/gofpdi.go:124
github.com/rorycl/rm2pdf/rmpdf.constructPageWithLayers({0xc0000c0480, 0x1, {0xc0000e6540, 0x2a}, {0x0, 0xed92b2429, 0x75c9a0}, 0x3, 0x3, {0x0, ...}, ...}, ...)
	/home/tsutsumi/remarkable-files/rm2pdf/rmpdf/pdf.go:90 +0x358
github.com/rorycl/rm2pdf/rmpdf.RM2PDF({0x7fff034930a1?, 0x1?}, {0x7fff034930e0, 0x8}, {0x0?, 0xc000030500?}, {0x0, 0x0}, 0x0, {0x0, ...})
	/home/tsutsumi/remarkable-files/rm2pdf/rmpdf/pdf.go:334 +0x3c5
main.main()
	/home/tsutsumi/remarkable-files/rm2pdf/main.go:63 +0x165

DnD_5E_CharacterSheet - Form Fillable copy.zip

from rm2pdf.

rorycl avatar rorycl commented on September 4, 2024

Hi @diegotsutsumi

Thanks for the report. Unfortunately this is a gofpdi issue and it seems unlikely the author will be updating the project.

I've tried using the pdfcpu library to first process source pdfs, but it often fails too.

The most reliable way I've found to working around the issue of many pdfs having non-standard or corrupt formats is by using the pdftk tool outside of rm2pdf.

Does resaving the pdf using pdftk work for you? For example convert the file with pdftk <original_file.pdf> cat output <output_file.pdf> then move <output_file.pdf> to <original_file.pdf> (after making a backup of the original file), then re-run rm2pdf. This always works for me.

from rm2pdf.

diegotsutsumi avatar diegotsutsumi commented on September 4, 2024

So yeah, it did work for this case indeed. I see this is documented in README.md and in in ./rm2pdf --help as well, my bad not seeing this before. Thanks for the tip.

It worked for this one, however not for all pdf files I have in my remarkable, pdftk doesn't fix a couple of them. I keep seeing gofpdi errors for these, unfortunately they're all confidential files I can't upload here.

I guess for these cases we'd be blocked on gofpdi fixes, but thanks for pointing the pdftk workaround.

from rm2pdf.

rorycl avatar rorycl commented on September 4, 2024

Closing as wontfix due to problem with gofpdi; reported upstream.

from rm2pdf.

Related Issues (10)

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.