1

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:

  • Activate the OLE object and use a method in there
  • Read the blob and have something that extracts the PDF part (possibly Apache POI)

But I haven't touched any of these approaches and was wondering if some advice could save me hours of tests

stwissel
  • 20,110
  • 6
  • 54
  • 101
  • What methods do the PDF OLE objects expose to LotusScript? – Richard Schwartz Oct 23 '12 at 10:48
  • Good question. activate I suppose, but then... I need help :-) – stwissel Oct 23 '12 at 22:50
  • It's been too long since I even thought about OLE automation in Notes, so I don't remember enough to really be of help. But I did find a reference for the Acrobat OLE API: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Acrobat9_HTMLHelp&file=IAC_API_OLE_Objects.103.1.html – Richard Schwartz Oct 24 '12 at 01:47
  • It looks like there is a save method in the AcroExch.AVDoc class. – Richard Schwartz Oct 24 '12 at 04:51
  • Same here. When someone says OLE I think about a Spanish greeting. Time to dust off some memories :-) – stwissel Oct 25 '12 at 01:43

2 Answers2

1

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.

jjtbsomhorst
  • 1,667
  • 11
  • 28
  • That step is fairly easy. The problem starts when you have that blob in memory. Writing it out to disk doesn't create a PDF file. It is an OLE container - what do to with is is exactly my question – stwissel Oct 23 '12 at 22:50
0

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 :-)

Normunds Kalnberzins
  • 1,213
  • 10
  • 20