Help! How do I extract 3D objects from PDFs?
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:
Nifty, right?
So, how do we extract that 3D file?
- 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.
Unfortunately, nothing opens it. I've tried Meshlab, Blender, FreeCAD, i3D Converter, online service Babel3D, and even Unity 3D on a Windows box.
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!
John says:
Rahul says:
Terence Eden says:
George says:
Ethan says:
Terence Eden says:
Terence Eden says:
Viktor says:
Terence Eden says:
David Malpica says:
George says:
yareckk says:
@edent says:
Angus says:
Dan says:
Federico says:
Su says: