Page 1 of 1

View Generated PDF

Posted: Fri Sep 22, 2017 5:27 pm
by collectordave
Writing a programme using PurePDF. On windows all working just one teething problem on the MAC.

On Windows this displays the PDF after saving.

Code: Select all

    RunProgram(GetCurrentDirectory() + "Albums\" + App::Title1 + ".PDF")  
This works when run from within PB and also when compiled into an exe.

Had to modify this to work on the MAC to this

Code: Select all

  RunProgram("Open", Chr(34) + GetCurrentDirectory() + "Albums/" + App::Title1 + ".PDF" + Chr(34),"")  
Again works when run in PB, but when I create and run the application it does not work!

What am I doing wrong?

Regards

CD

Re: View Generated PDF

Posted: Fri Sep 22, 2017 7:25 pm
by Wolfram
I think it's because GetCurrentDirectory() returns the "Contents" folder of the app package and there is no folder "Albums/".

On OSX you should place the folder inside of the Resources folder which is inside of the Contents folder.

path.s = GetCurrentDirectory() +"/Resources/Albums/"

Re: View Generated PDF

Posted: Fri Sep 22, 2017 10:50 pm
by mk-soft
I have create me a IDE-Tools for own data into the APP packet

Link http://www.purebasic.fr/english/viewtop ... 19&t=61638

Re: View Generated PDF

Posted: Sat Sep 23, 2017 4:55 am
by collectordave
Ah! Thanks to both.

I think I am getting the idea.

1. On windows "Create Executable" does just that creates a single file executable and places it where you want.

2. On MAC "Create executable" creates a folder that contains the executable along with a contents folder.

So to recreate what is happening on the MAC I need to create my windows executable in its own folder where of course the data does not exist and I hit the same problem. So must copy all data required to that folder.

On the MAC I copied all data to the contents folder of the APP and all worked fine. Is there an easy way to tell PB to include files and folders in the executable? I will look into mk-soft solution when I get a little more confidence on the MAC.

Again thanks to all

CD

Re: View Generated PDF

Posted: Fri Oct 06, 2017 5:56 am
by collectordave
Just starting with Linux.

Hit a simlar problem the pdf would not display however think it is a workaround

Used

Code: Select all

RunProgram("evince", Chr(34) + GetCurrentDirectory() + "Albums/" + App::Title1 + ".PDF" + Chr(34),"") 
Which works on my new install of Ubuntu 16.04.

Will this hit any problems?


Cheers

CD