Playmaker Forum

Playmaker Help & Tips => Playmaker Help => Topic started by: Gida on February 26, 2016, 06:16:16 AM

Title: Open Document?
Post by: Gida on February 26, 2016, 06:16:16 AM
Hey! Whats the best way to open a Document like a PDF from within the game with playmaker is there an action?

Greetings :)
Title: Re: Open Document?
Post by: dudebxl on February 26, 2016, 09:37:14 AM
maybe this will help: http://www.francescogallorini.com/2011/02/unity-sharp-pdf/
Title: Re: Open Document?
Post by: Gida on February 29, 2016, 12:49:07 AM
Hey and many thanks. But I simply want to launch a PDF in the external Reader on a button Press. :)
Title: Re: Open Document?
Post by: djaydino on February 29, 2016, 05:49:39 AM
Hi,
for which platform are you building?
Title: Re: Open Document?
Post by: Gida on February 29, 2016, 06:53:18 AM
Hey Dino,

PC / MAC
Title: Re: Open Document?
Post by: Gida on February 29, 2016, 09:24:11 AM
got something?
Title: Re: Open Document?
Post by: dudebxl on March 01, 2016, 10:40:32 AM
If you are on PC/Mac, try this in a C# script (edit path to whatever)

System.Diagnostics.Process.Start(@"c:\myPdf.pdf");
Title: Re: Open Document?
Post by: Gida on March 02, 2016, 01:10:06 AM
THNX, will try :)
Title: Re: Open Document?
Post by: Gida on March 02, 2016, 03:30:32 AM
Worked like a charm :) Thank you, solved
Title: Re: Open Document?
Post by: Gida on March 03, 2016, 09:55:48 AM
hm but not from touch. is there another solution???
Title: Re: Open Document?
Post by: dudebxl on March 03, 2016, 10:20:52 AM
what do you mean by touch? You mean from a mobile device?
Title: Re: Open Document?
Post by: Gida on March 04, 2016, 12:51:29 AM
Hi,

I think ive got a problem with the path. The Document should be launched from the root Folder so I replaced "c:\myPdf.pdf" with ..\myPdf.pdf".
1st Question : Is this correct?

2nd Question: shall I put it in the update or start function?

Greetz

EDIT:

when testing and switching to runtime, where should the
Title: Re: Open Document?
Post by: dudebxl on March 04, 2016, 07:35:00 AM
Try this action.. let me know if it works in the build (so that i can put on the ecosystem).

This is only for OS & Win (maybe mobile!!! - it should work but not tested) and uses System.Diagnostics.Process.Start

I tested with a picture from dropdown Mypictures and it works for me.

Thx
Title: Re: Open Document?
Post by: pietwelve on September 13, 2017, 05:27:56 PM
Hi dudebxl,
I'm trying you action that i'm very interested in.
It works fine when the .pdf is in  "my pictures" windows folder, but I can't have it work with the .pdf file in the Game Asset Folder. Sorry if it sounds dummy.
My setup is :
filename : temp.pdf; file path : temp.pdf; set path : streaming asset path
and the temp.pdf file in the Asset folder.