Hello Praveen,
I would:
1) retrieve the byte stream and store it into a blob;
2) save the blob to a local file (image/pdf);
3) display the local file (use the PB Picture control if an image, or the MS Web Browser Ole control if a PDF)
In details:
1) convert byte stream to blob
byte lbytes[]
Blob lblb
// read the byte array from external API
lBlobLen = UpperBound(lbytes)
lblb = Blob(Space(lBlobLen), EncodingAnsi!)
For lBytePos = 1 To lBlobLen
BlobEdit(lblb, lBytePos, lbytes[lBytePos], EncodingANSI!)
Next
2) save the blob to a file
integer li_FileNum
li_FileNum = FileOpen("myfile.jpg", StreamMode!, Write!, LockWrite!, Append!) // same if PDF or other image formats
FileWriteEx(li_FileNum, lblb)
FileClose(li_FileNum)
3) display the file
p_1.picturename = 'myfile.jpg' // use Picture control
----
ole_1.object.navigate (sle_pdffile.text) // use MS Web Browser ActiveX
Cheers,
Marco