Git Product home page Git Product logo

Comments (4)

practicingruby avatar practicingruby commented on July 19, 2024

Thanks for reporting this issue.

It looks like removing all of this code from PDF::Core breaks the unsupported prawn-templates gem. To restore the functionality, someone will need to either add monkey patches to PDF::Core in prawn-templates, or suggest sane extension points for me to add to PDF::Core which will allow prawn-templates to add the functionality without requiring a monkey patch.

If someone prepares a pull request to prawn-templates I'll merge it and cut a release, but it's unsupported for a reason: The feature is fatally flawed in ways that guarantee corruption in your documents as you continue to use various different kinds of PDFs and Prawn features. In that sense, it's behavior is undefined and for all practical purposes, undefinable. To really fix its problems, it'd need to be rewritten with a clear set of rules for document modification. I don't even know where to begin on that problem, sadly.

You're correct that this codepath was still accessible from Prawn 1.0.0, and it should no longer exist there. I cut a new gem that removes it.

from pdf-core.

bvogel avatar bvogel commented on July 19, 2024

@sandal If I understand correctly what you recommend would be that prawn-templates parses the template PDF and adds the retrieved nodes via (currently not existing) API calls to PDF::Core to a document? Afterwards the processing should continue as normal?

from pdf-core.

practicingruby avatar practicingruby commented on July 19, 2024

@bvogel The difficulty is that we need to parse the PDF and make sure to get both PDF::Core and Prawn synced with it internally.

Read up on this thread, it is the closest thing we have to a good summary of the problem:
https://groups.google.com/forum/#!msg/prawn-ruby/S6gXA-i0-do/fe98QFnhXw0J

The problem is that Prawn doesn't build up an internal representation of the PDF it's building at a high enough level to make it easy to merge in external documents.

The solution is probably to make PDF::Core capable of actually being a sort of DOM for PDF, but I haven't even started to think about how to make that happen.

from pdf-core.

robinboening avatar robinboening commented on July 19, 2024

I am also using the templates and ran into this issue.
I would be very happy about a solution that brings that feature back again.
Thanks for your work @sandal

from pdf-core.

Related Issues (15)

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.