Comments (4)
One issue with this functionality is that PDF splitting can break accessibility. Unfortunately, my research so far has failed to find a quick fix for this, for a couple reasons:
-
The easiest workable solution would be to modify the PDF to remove pages, rather than creating a new PDF, so that the accessibility data remains intact. Unfortunately, all the Python PDF APIs I've found only open a document for reading or for writing, and the writing APIs always create a new PDF rather than taking an existing one. This is likely due to the technical complexity of modifying an existing PDF.
-
None of the Python APIs I've explored so far offer the ability to both read and write accessibility info to PDFs. A vast majority of the Python libraries I've explored are concerned with converting to and from PDF, and don't consider PDF accessibility as a feature at all.
For reference, here's some of the libraries I've explored so far:
- PyPDF2 - The library we currently use. Can read and write, but does not handle accessibility data at all.
- pdfminer - Does provide read access to at least some of the accessibility data we need. The problem is that it's read-only, so we lack a library to write that data into the split PDF.
- ReportLab - Write only, does not appear to have accessibility writing APIs, though documentation is somewhat sparse so it's possible it's in the source somewhere.
I will keep exploring, but if I cannot find a library that supports adding accessibility data into PDFs, we will either need to extend an existing library or seek other solutions to splitting the PDF in order to keep accessibility. With pdfminer, we can at least warn about the loss of accessibility support when it happens.
from pressurecooker.
This task is on hold as we will probably just implement the ability to have ContentNodes display specific a PDF page range instead, in order to keep accessibility.
from pressurecooker.
Here is the PDF-splitting logic used in Open Stax chef:
https://github.com/learningequality/sushi-chef-openstax/blob/master/utils/pdf.py#L93-L112
Recommended commercial product to check:
https://www.pdflib.com/download/pdflib-product-family/
recommendation on stack overflow:
from pressurecooker.
PDF splitting utils are now provided in ricecooker, see https://ricecooker.readthedocs.io/en/latest/pdfutils.html#pdf-splitter
from pressurecooker.
Related Issues (12)
- ffmpeg fails to encode some videos HOT 2
- Feature request: 16x9 aspect ratio thumbs HOT 1
- Mac Invalid GUI HOT 6
- Convert srt subtitles to vtt format HOT 1
- Audio quality suffers during compression HOT 5
- Extract metadata from PDFs HOT 1
- srt2vtt dependecy webvtt-py is Py3.4+ only HOT 2
- Add Travis and tox.ini and setup automated testing HOT 1
- Subtitles formats and compatible youtube_language code checks HOT 1
- Conflicting versions of lxml HOT 4
- le-pycaption dependency: There are other active upstreams HOT 1
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 pressurecooker.