PDF myDocRef

Interested adding compiled externals from LiveCode and third parties to your LiveCode projects? This is the place to talk about them.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

PDF myDocRef

Post by reelstuff » Mon Mar 03, 2008 4:57 pm

Hello everyone, I am looking into using the Quartam PDF library,

In the example, myDocRef, I can see that it must refer to some text, in some form, that is to be written to the PDF file,

Example in docs

Code: Select all

qrtPDF_WriteText myDocRef, tLineHeight, tURL, tURL
qrtPDF_WriteText myDocRef, 13, myLongText 
How would one go about storing the text, in what location and in what form, rtf, doc, plain text, ect,

so it can be referenced by myDocRef, to print to PDF

Can I create a hidden card or stack with the text and reference that to print the text to PDF?

Or does it have to be stored as an external file?

Code: Select all

 put the uLongText of me into tLongText
I tried an example to see if I could create a text file, but the storage of that file and reference of that file into tLongText, eludes me currently,

Any thoughts or suggestions are always appreciated.

Tim

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Post by trevordevore » Tue Mar 04, 2008 2:50 am

The text you supply to qrtPDF_WriteText can come from anywhere really. The text should be plain text and (not htmltext or rtftext) and should be in ISO 8859-1 encoding.

If you need to format text take a look at the demo 2 script "Text boxes and areas example" which demonstrates calls to qrtPDF_SetFont, qrtPDF_SetTextColor, etc.

To store text for use with qrtPDF I would probably use a custom property. That way you can store the text using with the proper ISO encoding and pass the custom property contents to the library:

Code: Select all

qrtPDF_WriteText myDocRef, 13, the uMyCustomText of card 1 of stack "MyStack"
An easy way to store the text in the custom property would be to paste it into a Revolution field and execute the following in the message box:

Code: Select all

## OS X: need to convert field text encoding from mac roman to iso
set the uMyCustomText of card 1 of stack "MyStack" to macToIso(the text of field "MyField")

## Windows: field text encoding is already in iso
set the uMyCustomText of card 1 of stack "MyStack" to the text of field "MyField"
If you wanted to load data from a file you could use the open/read/close file commands or put URL (put URL thePathToFile into theText). You need to make sure that the text is encoded properly however.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Post by reelstuff » Tue Mar 04, 2008 3:40 am

Thank you, I really appreciate your post, You put it all where I could understand it and make it work,

Also gave me a few other ideas I had not thought of doing,

Thanks again.

Post Reply

Return to “Using Externals”