Wednesday, May 5, 2010

To write Images along with HTML text into a file created in an App Engine in PeopleSoft

To write Images along with HTML text into a file created in an App Engine in PeopleSoft

It's possible to write images along with HTML text.
Sample Code:
1. Create a new HTML Object as follows:
!html <>
!body
!img src="cid:23abc@pc27" /
!/html
!/body
cid stands for the Content Id
2. Sample PeopleCode:
Local string &STRLURL = GetURL(URL.IMG_PATH);
&image.SetAttachmentContent(&STRLURL, %FilePath_Absolute, "sample.jpg", "This is a sample image!", "", "");

/* The Content ID in the code (Highlighted) must be same as Content ID in HTML */

&image.AddHeader("Content-ID", "23abc@pc27");
We have used this to display html image and text in email notifications. You could try it for documents and let us know if it works for you.

1 comment:

  1. The Sample PeopleCode u have written i didn't understand where should i write it. Could u plz mention it in proper way.

    ReplyDelete