Tuesday, 2 December 2014

What the actual PDF

At lunchtime I took a moment away from writing stuff that monitors energy and did a little more of a Skunk Works private project that is making old WI documents available online.

The trouble is a few of them were what can only be described as uncooperative. Or what we refer to in the trade as bastards.

In a nutshell they were what look like Microsnot docx files that had PDF attachments. But I don't have Word. Awkward.

Even more awkward because whilst Google Docs was vaguely aware it had an OLE in the docs it had no way to display it. And as for Open Office, well, they know narrthing. Blank pages. Grr.

So: Plan A.

Consult my local friendly librarian, aka my lovely flatmate. I asked if I could email a file to see if she could get at the object and save it before finally sending it back. But then I had a moment of inspiration, I remembered that Microsnot had made Word available online, woo hoo go plan B!

Plan B.

After numerous attempts to remember by Microsnot Live password I admitted defeat and got them to reset it for me, scampered off to the online Word, eventually worked out how to upload a file in to their OneDrive and then looked at what I needed to look at...

Oh FFS. Didn't work. Back to Plan A.

Plan A: reprised

So my flatmate loaded up her Word, opened the file, saw the PDF and tried to get the file out. I bounced with glee when she said the file had been dragged to email, hurrah!

The email turned up, I opened it, I got excited when I saw that I did indeed have what looked just like what I would expect...

Until I clicked on the PINK.pdf and the iBastard preview tool showed me... The icon.

Not the PDF.

What the actual...

I will laugh about this later. So I curtailed my lunchtime entertainment, and went back to feigning being clever and actually trying to work out what stuff I have available that can then be used to improve a client tool.

And then there was Plan C...

A little later I had a sudden recollection that a docx is actually a zip file. Oh.

I skipped back to my terminal window and...

  • copied the file to p1.zip
  • opened the file in the iBastard finder
  • navigated to word/embeddings and saw that there was a big fat file called oleObject1.bin
  • I said ooh
  • And then renamed it to oleObject1.pdf and...
  • Opened the PDF!
Yes it's a bit of a faff but it did mean my archiving project can continue.


No comments:

Post a Comment