0
Reply

Save PDF to Isolated Storage and retrive Windows Phone app

Aditya Patil

Aditya Patil

Aug 4 2014 1:05 AM
723
I want to save PDF file to the Isolated Storage of Windows Phone and retrive it from Isolated Storage and show it in windows phone app screen, not use launcher.

So As per google result I found link and As per specified on the link http://our.componentone.com/groups/topic/save-pdf-file-to-local-storage/

I followed the steps and written below code but getting error as mentioned below.

private void saveloadpdf()
{
    using (var store = IsolatedStorageFile.GetUserStoreForApplication())
    {
        using (var stream = new IsolatedStorageFileStream("C1XapOptimizer.pdf", FileMode.Create, FileAccess.Write, store))
        {
            c1PdfViewer1.SaveDocument(stream);
        }
    }
    using (var store = IsolatedStorageFile.GetUserStoreForApplication())
    {
        using (var stream = new IsolatedStorageFileStream("C1XapOptimizer.pdf", FileMode.OpenOrCreate, FileAccess.Read, store))
        {
            c1PdfViewer1.LoadDocument(stream);
        }
    }

Its showing the below error

    "{Error 1 'C1.Phone.PdfViewer.C1PdfViewer' does not contain a definition for 'SaveDocument' and no extension method 'SaveDocument' accepting a first argument of type 'C1.Phone.PdfViewer.C1PdfViewer' could be found (are you missing a using directive or an assembly reference?) C:\Users\Aditya\Documents\Visual Studio 2013\Projects\Media\Media\MainPage.xaml.cs 116 34 Media"

How I can solve the problem? Please guide me its urgent help need, not getting any help. Anyhow I want to store file in Isolated Storage and retrieve from there, Its requirement of my app, don't ask me why you are saving the PDF to Isolated Storage and all.

Note: I can't indent the code properly I tried well but if mistake is there sorry for that, hope I will get reply soon.