Open PDF once created

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Brudders
Posts: 9
Joined: Thu Sep 08, 2022 10:38 am

Open PDF once created

Post by Brudders » Sun Apr 21, 2024 1:00 pm

I have a process that creates a PDF then puts the output path into a new substack that has a browser widget.
The problem is sometimes the PDF is still in the process of being created after the Browser substack is opened causing browser widget to fail to displaying it.

Is there away to only open the substack once the pdf has been created ? Any ideas TIA

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9416
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Open PDF once created

Post by richmond62 » Sun Apr 21, 2024 1:08 pm

Presumably your PDF creation script needs a wait statement in it until the whole process has completed.

Brudders
Posts: 9
Joined: Thu Sep 08, 2022 10:38 am

Re: Open PDF once created

Post by Brudders » Sun Apr 21, 2024 1:16 pm

Yeah I kinda thought the same thing, but how are you able to determine the creation process has finished in order to continue I guess is the question.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9678
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Open PDF once created

Post by dunbarx » Sun Apr 21, 2024 1:41 pm

The problem is sometimes the PDF is still in the process of being created after the Browser substack is opened
I am not sure, but this does not make sense to me. Someone like Richard will pipe in about whether LC, being single-threaded, can go off creating something like a PDF, at the same time it is opening and running scripts in another stack.

Interested in the comments to come...

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9416
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Open PDF once created

Post by richmond62 » Sun Apr 21, 2024 2:02 pm

LC, being single-threaded
You'd think that'd make sense: but I wonder as 2 stacks are involved . . .

Brudders
Posts: 9
Joined: Thu Sep 08, 2022 10:38 am

Re: Open PDF once created

Post by Brudders » Sun Apr 21, 2024 3:01 pm

I should also probably mention this is for a windows standalone. It is only on other customers computers I am seeing this I believe it is because they are slower PCs. I have added a refresh button on the card so if the PDF is not loaded into the browser they can manually load it as a work around.

Brudders
Posts: 9
Joined: Thu Sep 08, 2022 10:38 am

Re: Open PDF once created

Post by Brudders » Sun Apr 21, 2024 4:08 pm

Found the issue, I was doing something dumb passing the set widget parameter after launching browser stack. Adjusted that and working as intended. Thanks for looking.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9678
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Open PDF once created

Post by dunbarx » Mon Apr 22, 2024 3:42 am

Brudders.

Glad it worked out. Most of my issues are forehead-slappers, and only after making myself believe that it could not possibly be me.

But I am still interested in finding out about the original postulate, that is, does this:
The problem is sometimes the PDF is still in the process of being created after the Browser substack is opened causing browser widget to fail to displaying it.
actually make any sense?

Craig

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”