converting progres4GL blob file to pdf in c#

Status
Not open for further replies.
M

Milka Salkova

Guest
Hello I've got a simple webservice in Progres4Gl from which I receive as output parameter dataset with blob in whoich I have coppied a pdf file.

DeFINE TEMP-TABLE TTDocument NO-UNDO
FIeld DocSeqNr As INT
FIELD FileName AS CHAR
FIELD EventCode As CHAR
FIELD EventDescr AS CHAR
FIELD FileContent AS BLOB
.


DEFINE DATASET ds FOR TTDocument.

DEFINE INPUT PARAMETER pCoCd AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pLanCd AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pUsrCd AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pFilter AS CHARACTER NO-UNDO.
DEFINE OUTPUT PARAMETER DATASET FOR ds.
DEFINE OUTPUT PARAMETER pErrorTxt AS CHARACTER NO-UNDO.


In .Net I make a request to this web service and I handle the response like this :

XmlElement doc;
DataSet xxx = new DataSet();
beaHostDB.GetDocumets(pCoCd, lanCd, pUsrCd,idAdd, out doc, out pErrorTxt);
XmlElementToXmlDocment(doc);
var reader = new StringReader(doc.InnerXml);
xxx.ReadXml(reader);
foreach (DataRow dr in xxx.Tables[0].Rows)
{
DcumentList.Add(new Document { FileContent =dr["FileContent"].ToString});
}


SO I have now a string with the binary representation of this pdf file How can I convert this string to bytes[] to get this pdf file in c#

Continue reading...
 
Status
Not open for further replies.
Top