Highlighted

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

Community Beginner ,
Sep 14, 2020

Copy link to clipboard

Copied

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

TOPICS
Acrobat SDK and JavaScript, Create PDFs, Edit and convert PDFs, General troubleshooting, How to, PDF forms, Print and prepress, Security digital signatures and esignatures, Standards and accessibility

Views

35

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

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

Community Beginner ,
Sep 14, 2020

Copy link to clipboard

Copied

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

TOPICS
Acrobat SDK and JavaScript, Create PDFs, Edit and convert PDFs, General troubleshooting, How to, PDF forms, Print and prepress, Security digital signatures and esignatures, Standards and accessibility

Views

36

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 14, 2020 0
Most Valuable Participant ,
Sep 14, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 14, 2020 0