Q:

Copy or open external file in windows RT app

I would like to show a pdf from a website in my windows rt app (for Desktops with windows 8). How can I handle this?
If I add the file manually to the asset I can display it. But how can I do this with files where are not located on my asset Folder?

Can I copy the file to the StorageFolder?
Or can I directly open the file from the website?

Please give me some hints how I can solve this.
THX

A:

Hi I want to open it in my app and I not want to use the launcher.
I copy the file with HttpWebRequest to LocalFolder and process the pdf. I've solved it this way:
StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFile file = null;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(filepath);

//TODO Systemuser
request.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
var response = await request.GetResponseAsync();

List<Byte> allBytes = new List<byte>();
using (Stream imageStream = response.GetResponseStream()) {
      byte[] buffer = new byte[4000];
      int bytesRead = 0;
      while ((bytesRead = await imageStream.ReadAsync(buffer, 0, 4000)) > 0) {
           allBytes.AddRange(buffer.Take(bytesRead));
      }
}

file = await localFolder.CreateFileAsync(fileName, CreationCollisionOption.ReplaceExisting);
await FileIO.WriteBytesAsync(file, allBytes.ToArray());

await RenderPDFPage(fileName);

