Page 1 of 1
Clever document by livecode generator
Posted: Mon Dec 10, 2012 6:16 pm
by user#606
Hi,
Imagine a comparison chart, where you have apartment numbers down the left and the features along the top.
This can be achieved with livecode using the basic grid so that the cell value, if clicked on, can take you to the card/page that expands the explanation of the cell value.
Now, Adobe will allow clicking on the cell (suitably formatted as a link) to take the user to the appropriate page. Obviously not the paper printout, just the computer screen representation of the chart/page.
The question is, is it possible to generate such a pdf (assuming a proper implementation of pdf generation) from livecode.
If so, has anyone advice or indicative code snippet for the cell so it can produce Adobe pdf links and function.
I look forward to your opinions.
Re: Clever document by livecode generator
Posted: Mon Dec 10, 2012 7:29 pm
by Mark
Hi,
Perhaps you can do this with Qartam's PDF lib, but I never tried this.
Kind regards,
Mark
Re: Clever document by livecode generator
Posted: Tue Dec 11, 2012 7:04 pm
by jacque
Take a look at the dictionary entry for "print link". This lets you assign a clickable link when printing to PDF. I've never used it but apparently it's for exactly what you want to do.
Re: Clever document by livecode generator
Posted: Wed Dec 12, 2012 5:21 pm
by user#606
Thanks jacque
I had already looked at that and in conjunction with a lesson, found that the explanation was beyond me.
I see RTF and other markup systems inply you can create a link, but fail to explain.
I expected the word or phrase that is the visible link in the text to ahve a code at the start, perhaps the link address in brackets and a closing code.
Perhaps this is impossible to do!
What is the point of the Link tickbox on the menu bar -> Text . All it does is format the selected text with colour and underline. Another blind ally!
Are there any users out there that can provide help on this issue, with a snippet of workable code?
Re: Clever document by livecode generator
Posted: Wed Dec 12, 2012 5:47 pm
by sturgis
Have you looked at this lesson?
http://lessons.runrev.com/s/lessons/m/4 ... g-livecode Might help you get a better grasp on printing to pdf.
Re: Clever document by livecode generator
Posted: Wed Dec 12, 2012 6:03 pm
by user#606
Yes, this is the lesson I referred to.
Having worked past the bits that dont work, I concluded this was a sledge hammer to crack a nut, when I reached "Bookmarks". If Livecode cannot do it simply, then it is a waste of time.
I experimented with a simple word doc and can reproduce the results I expected from Livecode, when printed as a pdf. So, I know that it is a viable solution to my task. Only Livecode stands in my way.
Thanks for your input.
Re: Clever document by livecode generator
Posted: Wed Dec 12, 2012 7:19 pm
by jacque
According to the docs, LiveCode does do what you want. Setting the textstyle to "link" formats the selection with an underline and a color, and will treat it as linked area.
Note that the automatic behavior is to treat the text itself as the reference you want to jump to. That means you can't use text that says one thing and have it link to some unrelated text in the field. If you do want that behavior then you need to script a very precise print handler that manually sets up all the rectangles and references.
So this text in a field should work automatically:
As we mention in Section 2, blah blah blah.
Clicking "Section 2" would anchor to some section of your document called "Section 2". It won't link to text called "Chapter II" unless you write a print handler that specifically tells it to. I'm going by the docs, I haven't ever had to do this, but that's my understanding of it.