You need to get the XFileRefNum first.
Bring in the Ice.Contracts.BO.Attachment DLL
using Ice.Proxy.BO;
.....
Ice.Proxy.BO.AttachmentImpl attachmentBO = attachmentBO = WCFServiceSupport.CreateImpl<Ice.Proxy.BO.AttachmentImpl>((Ice.Core.Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.AttachmentSvcContract>.UriPath);
var fileData = attachmentBO.DocStarDownloadFile(xFileRefNum,ref metaData);
string fileName = Path.GetTempFileName().Replace(".tmp",".pdf");
File.WriteAllBytes(fileName, fileData);