You know how the Democratic People’s Republic of Korea is neither democratic, nor particularly for the people, nor a republic? Yeah, so it turns out the “Universal 3D” format is pretty far from Universal!
A little backstory… The Europeana Carare Project has some gorgeous 3D scans of ancient monuments and heritage sites. The only problem is that the 3D files are trapped inside PDFs. Yup – did you know the PDF spec supported 3D models? Me neither.
The only way to view these is with the Official Adobe Viewer (install it on Linux following these instructions).
This is what it looks like:
- Download and install the Pythong PDF Parser
- Search for the 3D object:
./pdf-parser.py -t /3D input.pdf
- You’ll get a response like this:
obj 48 0 Type: /3D Referencing: 58 0 R, 59 0 R Contains stream << /AN 58 0 R /Length 6066066 /Subtype /PRC /Type /3D /VA 59 0 R >>
- The Object ID (in this case 48) is what we need to extract.
./pdf-parser.py -o 48 -d output.u3d input.pdf
You can download the U3D file.
Nothing! Not a single application would recognise it – let alone convert it.
There is a U3D library on GitHub – but I’m not skilled enough to integrate it into anything.
I’ve found an Android app which claims to convert U3D files – but it has no downloads, no reviews, and costs £6!
So, gentle reader, if you know of a way to extract and view 3D models from PDFs, please let me know!