Skip to main content
Known Participant
September 14, 2020
Question

Is it accessible Stream Object string to Object Stream in C#

  • September 14, 2020
  • 1 reply
  • 483 views

I'm using Java Script to convert Image to string and store in the field value. As we can see the below Javascript:

// Getting the Object
var oFile = this.getDataObjectContents("Test1");
//object into the string 
var cFile = util.stringFromStream(oFile, "utf-8");
// storing in the field
this.getField("Text2").value = cFile;

I'm reading all the field On the pdf and I'm able to get the field Value, but when I'm trying to write it, in the Server/Local machine I'm not able to write the image. I'm using the below code.

byte[] br;
 // (cc.Value)// value of the fieldbr = Encoding.ASCII.GetBytes(cc.Value);
//br=  imgToByteArray
byte[] pdfdata = Encoding.ASCII.GetBytes(cc.Value);

Stream streamed = new MemoryStream(pdfdata);
Stream InputStream = streamed;
byte[] result;

using (var streamReaderWE = new MemoryStream())
{
    InputStream.CopyTo(streamReaderWE);    result = streamReaderWE.ToArray();
    File.WriteAllBytes(fileNameEEEE, result);
}

 

Thanks

This topic has been closed for replies.

1 reply

Legend
September 14, 2020

This is not using Adobe products. rival products are not discussed here.