View Generated PDF

Mac OSX specific forum
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

View Generated PDF

Post 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
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Wolfram
Enthusiast
Enthusiast
Posts: 567
Joined: Thu May 30, 2013 4:39 pm

Re: View Generated PDF

Post 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/"
macOS Catalina 10.15.7
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: View Generated PDF

Post 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
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: View Generated PDF

Post 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
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: View Generated PDF

Post 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
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Post Reply