You can save and load PDF files to isolated storage using the C1PdfViewer control. To save a file to isolated storage you would need to call the SaveDocument method passing in an isolated storage file stream:
Public Sub New()
InitializeComponent()
' save file to isolated storage
Using store = IsolatedStorageFile.GetUserStoreForApplication()
Using stream = New IsolatedStorageFileStream("C1XapOptimizer.pdf", FileMode.Create, FileAccess.Write, store)
C1PdfViewer1.SaveDocument(stream)
End Using
End Using
End Sub
•C#
public MainPage()
{
InitializeComponent();
// save file to isolated storage
using (var store = IsolatedStorageFile.GetUserStoreForApplication())
{
using (var stream = new IsolatedStorageFileStream("C1XapOptimizer.pdf", FileMode.Create, FileAccess.Write, store))
{
c1PdfViewer1.SaveDocument(stream);
}
}
}
To load an existing file from isolated storage call the LoadDocument method passing in an isolated storage file stream:
Public Sub New()
InitializeComponent()
' load file from isolated storage
Using store = IsolatedStorageFile.GetUserStoreForApplication()
Using stream = New IsolatedStorageFileStream("C1XapOptimizer.pdf", FileMode.OpenOrCreate, FileAccess.Read, store)
C1PdfViewer1.LoadDocument(stream)
End Using
End Using
End Sub
•C#
public MainPage()
{
InitializeComponent();
// load file from isolated storage
using (var store = IsolatedStorageFile.GetUserStoreForApplication())
{
using (var stream = new IsolatedStorageFileStream("C1XapOptimizer.pdf", FileMode.OpenOrCreate, FileAccess.Read, store))
{
c1PdfViewer1.LoadDocument(stream);
}
}
}
What You've Accomplished
In this example you've saved and loaded PDF files to isolated storage using the C1PdfViewer control.