We have the need to have a thumbnail like functionality in a view. My thought was to have the user attach a small .jpg file to the corresponding document and then use LotusScript to create a image resource so it could be viewed directly from a view.
I would think with the NotesNoteCollection I should be able to accomplish it. I’m not seeing a way to insert a image resource.
I’m wondering if this can be done?
Subject: Creating an image resource from an document attachment, can this be done?
If you’re looking for a complete solution, we provide an lsx that you can use to create image resources.
The lotusscript code required to create an image resource would look something like:
Dim db as new notesIRdatabase(s.currentdatabase)
call db.addimageresource(“c:\myfile.jpg”,“IRName”)
You can find more information here (bottom of page):
http://www.peopleware.be/peopleware/public/tnreg.nsf
D.
Subject: Creating an image resource from an document attachment, can this be done?
Is this for a Notes client or a web application? If it’s for a Notes client (or combined) application, you should be able to it it via DXL (you’d need to stream the file into the appropriate field node in a new image resource note node, along with the other data required in their fields) with no more than a little difficulty. If it’s a web-only application, then there’s no need to create image resources – there are several threads in this forum dealing with attached images in web views.
Subject: RE: Creating an image resource from an document attachment, can this be done?
Stan - Thanks for the reply
It’s a Notes client application only.
Based on the fact you say it can be done, my thought now is to export the current document and reimport it using style sheet separating out the file attachment in that rich text field. Only thing I’m not sure about is how to “encode” the data between the tags. I noticed in my tests that is one long string.
Thanks again for your response and any other “direction” you can provide is much appreciated.
I’ll get the hang of this XML stuff yet!
Subject: RE: Creating an image resource from an document attachment, can this be done?
hi!
The binary content is base64 encoded. It can be done by using a notesstream to open a .jpeg on harddisk, stream it into a mimeentity, encode it as base64 (ENC_BASE64). Then put it between and .
That’s it.
Regards