Reputation: 20384
I have a database with tons of PDF documents embedded as OLE objects in Notes RichText fields. Those are not compatible with XPages, so I need to convert the OLE objects into file(attachment)s. How can I do that in an automatic fashion (I know that it must run in a Notes client (must it?) - or is there a POI way to extract them?
Clarification
I can extract the blob (into memory if I want), but writing it out to disk doesn't create a PDF File since that blob is an OLE container. So I see 2 possible path:
But I haven't touched any of these approaches and was wondering if some advice could save me hours of tests
Upvotes: 1
Views: 1870
Reputation: 1245
I'd think that something like searching for %PDF and then saving everything since as a file should five you PDF. Theoretically there could be a bunch of things in OLE file, but in most cases you'll get you file simply prefixed with an OLE header (or whatever it's called).
I've used this approach in one occasion (not for PDF though) and it seemed working fine.
I guess it's what openntf approach that jjtbsomhorst is talking about is based upon :-)
Upvotes: 0
Reputation: 1667
Would it be possible with dxl tools? I've worked with the dxl exporter to extract embedded images from a document maybe this is also doable with ole objects?
I used a slightly changed version of the EmbeddedImage object of the lotusscript gold collection project on openntf
This library contains an object Embeddedimagelist which searches the DXL for picture tags and tries to parse its contents. Maybe this would also be applicable with embedded ole objects.
Upvotes: 1