Click here to Skip to main content
15,886,110 members
Home / Discussions / Windows Development
   

Windows Development

 
GeneralRe: Windows Runtime applications; Updating title Pin
Afzaal Ahmad Zeeshan29-Jun-15 3:52
professionalAfzaal Ahmad Zeeshan29-Jun-15 3:52 
QuestionFile associations programmatically. Pin
Rainsey Long22-May-15 21:53
Rainsey Long22-May-15 21:53 
AnswerRe: File associations programmatically. Pin
Richard Andrew x6426-Jun-15 12:38
professionalRichard Andrew x6426-Jun-15 12:38 
QuestionEmbedding exe application on metro Pin
Rainsey Long22-May-15 21:48
Rainsey Long22-May-15 21:48 
Questionwhich function gets called in case of End Task for process running in Background Pin
N3KK21-Apr-15 4:23
N3KK21-Apr-15 4:23 
AnswerRe: which function gets called in case of End Task for process running in Background Pin
Richard Deeming21-Apr-15 5:14
mveRichard Deeming21-Apr-15 5:14 
AnswerRe: which function gets called in case of End Task for process running in Background Pin
Eddy Vluggen21-Apr-15 5:25
professionalEddy Vluggen21-Apr-15 5:25 
QuestionOpening pdf on Windows Phone 8 Pin
purplehorace30-Mar-15 22:00
purplehorace30-Mar-15 22:00 
Hello, I am writing a very simple app that is trying to launch a pdf viewer when a button is pressed or a selection is changed in a list.

I have the structure to generate an event when the selection is changed and I have the path to the pdf file; e.g. 'Assets/pdf/filetoopen.pdf'

I have been trying all kinds of methods without success;
C#
StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;

StorageFile pdfFile = await local.GetFileAsync((DetailsLongListSelector.SelectedItem as ContentViewModel).pdfLocation);

success = await Windows.System.Launcher.LaunchFileAsync(pdfFile);

That fails when using GetFileAsync.

I had thoughts about its due to access permissions and may need to copy to temporary storage before using, but I cant seem to make that work.

Is there any preferred method to open an pdf ?

Thanks

EDIT

OK I have managed to get it to launch by using:
C#
// Get the app's installation folder.
StorageFolder appFolder = Windows.ApplicationModel.Package.Current.InstalledLocation;

// Get a file from a subfolder of the current folder
// by providing a relative path.
StorageFile pdfFile = await appFolder.GetFileAsync((DetailsLongListSelector.SelectedItem as ContentViewModel).pdfLocation);

if (pdfFile != null)
{
    bool success = await Windows.System.Launcher.LaunchFileAsync(pdfFile);

The main problem was I needed to use the ApplicationModel instead of Storage.ApplicationData.

Now I have an issue with Adobe stating that the file already exists "do you want to replace ?"
Is there any way to force Adobe to overwrite ?

Thanks
AnswerRe: Opening pdf on Windows Phone 8 Pin
Richard MacCutchan30-Mar-15 23:14
mveRichard MacCutchan30-Mar-15 23:14 
QuestionManaged Languages on Windows Runtime Pin
Richard Andrew x6430-Mar-15 12:27
professionalRichard Andrew x6430-Mar-15 12:27 
QuestionAlways on top (Task Manager) C# Pin
Rainsey Long26-Mar-15 4:28
Rainsey Long26-Mar-15 4:28 
AnswerRe: Always on top (Task Manager) C# Pin
Herman<T>.Instance11-Aug-15 2:57
Herman<T>.Instance11-Aug-15 2:57 
Questionneed wi-fi scanner APP source code creating academic projects Pin
Member 1132033618-Dec-14 1:23
Member 1132033618-Dec-14 1:23 
AnswerRe: need wi-fi scanner APP source code creating academic projects Pin
Pete O'Hanlon18-Dec-14 2:02
mvePete O'Hanlon18-Dec-14 2:02 
QuestionRSA Encryption with Universal App Pin
Ryan_Be24-Sep-14 11:02
Ryan_Be24-Sep-14 11:02 
QuestionMy windows installation do not moving from 24 % Pin
SHUVO BISWAS4-Aug-14 20:52
SHUVO BISWAS4-Aug-14 20:52 
AnswerRe: My windows installation do not moving from 24 % Pin
ZurdoDev26-Sep-14 4:24
professionalZurdoDev26-Sep-14 4:24 
QuestionI can not access some folders Pin
Meysam Toluie2-May-14 8:37
Meysam Toluie2-May-14 8:37 
AnswerRe: I can not access some folders Pin
ZurdoDev30-Sep-14 9:54
professionalZurdoDev30-Sep-14 9:54 
QuestionWindows 8.1 hibernation bug Pin
ed welch11-Apr-14 4:14
ed welch11-Apr-14 4:14 
AnswerRe: Windows 8.1 hibernation bug Pin
ZurdoDev26-Sep-14 4:26
professionalZurdoDev26-Sep-14 4:26 
QuestionDo you find the metro interface appealing ? Pin
Armando de la Torre19-Feb-14 15:00
Armando de la Torre19-Feb-14 15:00 
AnswerRe: Do you find the metro interface appealing ? Pin
MatthysDT19-Feb-14 19:56
MatthysDT19-Feb-14 19:56 
RantRe: Do you find the metro interface appealing ? Pin
Frank T. Clark3-Jun-14 3:26
professionalFrank T. Clark3-Jun-14 3:26 
AnswerRe: Do you find the metro interface appealing ? Pin
AgentDigby27-Aug-14 6:34
AgentDigby27-Aug-14 6:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.