Comments (4)
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.
@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.
@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.
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)
- PDF::Core::Text has an implicit dependency on Prawn's map_to_absolute method
- Consider adding a higher level interface similar to add_content but with automated type conversions
- PDF::Core::Text should either be broken up or moved back into Prawn HOT 1
- Validation check issues HOT 3
- render should accept any writable IO object HOT 6
- failed to allocate memory HOT 5
- Warnings since update version 0.7.0 HOT 21
- Push source code for version 0.8.1 HOT 1
- undefined method `get_page_objects` for PDF::Core::ObjectStore HOT 4
- GPLv2 license file does not match latest revision HOT 1
- Release a new version? HOT 2
- Request for 'STATEMENT' paper size
- Typo in Readme HOT 1
- Limit all PDF decimal numbers to four decimal places HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdf-core.