Page 1 of 1

PDF myDocRef

Posted: Mon Mar 03, 2008 4:57 pm
by reelstuff
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

Posted: Tue Mar 04, 2008 2:50 am
by trevordevore
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.

Posted: Tue Mar 04, 2008 3:40 am
by reelstuff
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.