Hi Thomas
Think I've solved mine.
Like I said, I'm a novice at this so I'm not sure why this works and the origanal didn't.
So for anyone following in the future, This code now works:-
Code:
string strPDF = "http://MyServer/MyPdf.pdf;
byte[] buffer = new byte[4096];
WebRequest wr = WebRequest.Create(strPDF);
WebResponse response = wr.GetResponse();
Stream responseStream = response.GetResponseStream();
MemoryStream memoryStream = new MemoryStream();
int count = 0;
do
{
count = responseStream.Read(buffer, 0, buffer.Length);
memoryStream.Write(buffer, 0, count);
} while (count != 0);
PdfDocument inputDocument1;
try
{
inputDocument1 = PdfSharp.Pdf.IO.PdfReader.Open(memoryStream, PdfSharp.Pdf.IO.PdfDocumentOpenMode.Import);
}
catch(Exception ex)
{
lblMessage.Text = ex.ToString();
return;
}
All the best
Hawkmoth