Saving a PDF file to a new stack?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Saving a PDF file to a new stack?

Post by shawnblc » Mon Oct 28, 2013 12:41 am

Can you save a PDF file to a stack or a card? If so how do you go about this. I'm still trying to figure this one out. I can save the path, but not having luck with the file itself.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10332
Joined: Wed May 06, 2009 2:28 pm

Re: Saving a PDF file to a new stack?

Post by dunbarx » Mon Oct 28, 2013 1:17 am

Hi.

Pretty sure you can store it as a custom property of the stack.

Craig Newman

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Saving a PDF file to a new stack?

Post by Klaus » Mon Oct 28, 2013 4:30 pm

Hi Shawn,

do this:
1. "Suck" PDF IN:
...
set the cStoredPDF of this stack to url("binfile:" & tPath_to_PDF_here)
## Don't forget to save the stack!
...

2. "Spit" out:
...
put the cStoredPDF of this stack into url("binfile:" & tNew_Path_to_PDF_here)
...


Best

Klaus

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: Saving a PDF file to a new stack?

Post by shawnblc » Thu Oct 31, 2013 3:20 am

Is there a sample of saving a pdf file to a stack? I've searched here and the livecode tutorials and haven't seen anything. Thanks.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Saving a PDF file to a new stack?

Post by FourthWorld » Thu Oct 31, 2013 3:26 am

See the post immediately above yours.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: Saving a PDF file to a new stack?

Post by shawnblc » Thu Oct 31, 2013 3:40 am

FourthWorld wrote:See the post immediately above yours.
Richard, I read that and added it to a button to test out, guess I'm not understanding it though ;)
Still searching and reading though.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Saving a PDF file to a new stack?

Post by Simon » Thu Oct 31, 2013 3:54 am

Hi shawnblc,
Do you know how to use custom properties?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: Saving a PDF file to a new stack?

Post by shawnblc » Thu Oct 31, 2013 3:56 am

Simon wrote:Hi shawnblc,
Do you know how to use custom properties?

Simon
Maybe that's what I need to read up on. Going to read up on it now. I'll come back to this post. Thanks for the info.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Saving a PDF file to a new stack?

Post by Simon » Thu Oct 31, 2013 4:08 am

Using the property inspector use the drop down and select Custom Properties.
Then it's just like making a variable (just add any name you like maybe...cStoredPDF?), you don't have to put anything in it as Klaus's code will do that.

It's easy really, just not immediately obvious.

Simon
Edit: Oh... use the stack inspector
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: Saving a PDF file to a new stack?

Post by shawnblc » Thu Oct 31, 2013 5:59 pm

Maybe I'm making this more complicated than it needs to be.

I'm not drinking either.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Saving a PDF file to a new stack?

Post by Klaus » Thu Oct 31, 2013 6:29 pm

HI Shawn,

you're almost there :D
...
answer file "select PDF file"

## "/Users/Shawn/Desktop" ???
## This is NOT the file the user selected but a FOLDER!
## This will not work, means the CP is still empty!
## set the cStoredPDF of this stack to url("binfile:" & "/Users/Shawn/Desktop")

## Set the Custpom Prop to the file that has just selected!
set the cStoredPDF of this stack to url("binfile:" & IT)
...

Best

Klaus

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: Saving a PDF file to a new stack?

Post by shawnblc » Fri Nov 01, 2013 1:53 am

Hmmmmmm. Haven't given up and won't.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Saving a PDF file to a new stack?

Post by Simon » Fri Nov 01, 2013 2:18 am

This is better:
put the cStoredPDF of this stack into url("binfile:" & specialFolderPath("desktop") &"/savePDF.pdf")

I found trying to look at the Custom Property of the stack would hang the IDE.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: Saving a PDF file to a new stack?

Post by shawnblc » Fri Nov 01, 2013 2:33 am

Simon wrote:This is better:

I found trying to look at the Custom Property of the stack would hang the IDE.

Simon
Using 6.1.2 rc3 bld 2015 and 6.5.0 dp-2 I'm not having that issue. Using Mac OSX w/ Mavericks 10.9.

Let me try what you suggest now. This is driving me crazy. It's insignificant, but yet it's consuming me. lol.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Saving a PDF file to a new stack?

Post by Klaus » Fri Nov 01, 2013 11:53 am

shawnblc wrote:Hmmmmmm. Haven't given up and won't.
Success! :D
...
set the cStoredPDF of this stack to url("binfile:" & IT)
save stack "savePDF"
## Don't forget to add the correct SUFFIX -> binfile:/Users/Shawn/Desktop/savePDF.PDF
put the cStoredPDF of this stack into url("binfile:/Users/Shawn/Desktop/savePDF")
...

Post Reply