Domino 9 und frühere Versionen > Entwicklung
JPEG Bilder im Backend importieren
rocky29:
Hallo!
ich suche nach einer Möglichkeit ein JPEG Bild in ein RichText - Feld zu importieren, so daß es beim öffnen der Maske angezeigt wird.
Hab es schon mit EmbedObject probiert, aber da bekommt man bestenfalls einen Link zum Bild hin, bzw. ein Attachement.
Christopher:
Ich denke sowas läßt sich nur mit C-API lösen. Hier gibt es ein Produkt siehe http://www.peopleware.be/peopleware/public/tnreg.nsf/dft?openframeset
Semeaphoros:
Denke auch, das ist so, und da kann man an die traditionellen Richt-Text Gurus denken:
Normunds Kalnberzins mit rtlib http://www.rtlib.com
oder Ben Langhinrichs mit Midas http://www.geniisoft.com
Thomas Schulte:
Und beide Aussagen sind leider im Prinzip richtig, weil du deine Version nicht mitgegeben hast. Ab einer definierten V5irgendwas geht es nämlich auch ohne C und Midas.
Code folgt wenn ich wieder daheim bin.
Thomas
Thomas Schulte:
Also hundertpro im Backend geht das nicht, dann bleiben wirklich nur C-API, Midas und ähnliches übrig, aber wenn du damit leben kannst das ein Backend Dokument erzeugt wird, das Ganze ins Frontend geholt wird und anshcließend SOFORT wieder geschlossen, dann geht das hier:
Set newdoc = mydb.createdocument()
' Fill all the fields in the document
newdoc.form = "frmPictureData"
newdoc.keyTyp = descriptiondoc.KeyTyp(0)
Set stichwoerter = descriptiondoc.GetFirstItem( "keyStichwort" )
Call stichwoerter.CopyItemToDocument( newdoc, "txtStichwort" )
newdoc.keyKategorie1 = descriptiondoc.KeyKategorie1(0)
newdoc.keyKategorie2 = descriptiondoc.KeyKategorie2(0)
newdoc.keyKategorie3 = descriptiondoc.KeyKategorie3(0)
newdoc.keyKategorie4 = descriptiondoc.KeyKategorie4(0)
newdoc.keyKategorie5 = descriptiondoc.KeyKategorie5(0)
newdoc.txtBeschreibung = descriptiondoc.txtBeschreibung(0)
' Get the file that has to be attached and attach it
DirFile = Directory + Filename
' Check if the size of the object is equal or bigger then the defined Size
sizeinbytes = Filelen(DirFile)
If sizeinbytes >= Cdbl(descriptiondoc.numMinPictureSize(0)) * 1024 Then
' Compute the rest of the fields
success = newdoc.computewithform(False,False)
' save if computing was correct
If Success = True Then
Call newdoc.save(True,True)
End If
Set uiDoc = ws.EditDocument( True, newdoc )
Call uiDoc.GotoField( "rtxdata" ) ' or whatever the RTF field is called for the photo
Call uiDoc.Import( "JPEG Image", DirFile ) ' assumes the fileName field includes a full path to the file!!!
Call uiDoc.Save()
Call uiDoc.Close(True)
Set uidoc =Nothing
Wobei es auf den Uidoc.Close(True) ankommt.
Navigation
[0] Themen-Index
[#] Nächste Seite
Zur normalen Ansicht wechseln