I print an Invoice using the tPRINTER class. It is a complex document and I can NOT use the REPORT class. At the end of the document is the DISCLAIMER which the customers want to create themselves, and they want to highlight areas, underline other text, make some bold, and change print sizes. All of this is possible using the RTF5 class.
I am able to retrieve text from a memo field in an .FPT file, Edit it with the RichEdit5 control, and save it back to the .FPT file. Here is an example of what is saved which is the text and all of the control codes:
- Code: Select all Expand view
{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 ARIAL;}}
{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}
{\*\generator Riched20 10.0.22000}\viewkind4\uc1
\pard\f0\fs20 I, the Registered Owner hereby authorize the above repair work to be done along with the necessary materials, and hereby grant you and/or your employees, permission to operate the car, truck or vehicle herein described on streets, highways or elsewhere for the purpose of testing and/or inspection. I understand any cost quoted heretofore is an estimate only. All charges for labor are not based on actual mechanics time, but are established by multiplying our retail labor rate by industry time allowances or our own judgment of the time to be charged. \cf1 An express mechanic's lien is hereby acknowledged on the above car, truck or vehicle to secure the amount of repairs thereto\cf0 . In the event any attorney is retained to bring suit for collection of any sums due, I agree to pay costs of collection and reasonable attorney fees. I also understand that the dealer is not a depository for personal property left in the vehicle and assumes no risk for loss thereof. You will not be held responsible for loss or damage to vehicle, or articles left in vehicle in case of fire, theft, accident or any other cause beyond your control. If car is not picked up within (3) days after work is completed, a storage charge of $50.00 per day will be added to the total bill. I understand there is a $25.00 return check charge for all returned checks. I have read and understand the above. \par
\par
OWNER______________________________________DATE______________ \par
\b The dealer named above is authorized by me to perform Smog Control Inspection as required by Article 5.5 of the California Motor Vehicle Inspection Program. The total of performing required inspection services has been explained to my satisfaction. I understand I am liable for costs up to the estimated amounts shown whether the vehicle qualifies for certification or not. \b0 \par
\par
OWNER______________________________________DATE______________ \par
\cf2 SOME EMISSION CONTROL DEVICES MAY BE COVERED UNDER MANUFACTURES WARRANTY. BY LAW, YOU MAY CHOSE ANOTHER LICENSED SMOG CHECK FACILITY TO PERFORM ANY NEEDED REPAIRS WHICH THE SMOG TEST INDICATES ARE NECESSARY.\par
}
On the invoice, I normally print the text using the following code:
- Code: Select all Expand view
FOR lx := 1 TO MLCount( oEndText:tagtext, 120,, .T. )
WOPAGEHEAD( oPrn, aHead )
oPrn:SayText( nRow, 2 * nCsp, MemoLine( oEndText:tagtext, 120, lx,, .T. ),nCsp*120, nRsp * 1.1, oFcond )
nRow += nRsp
NEXT
This works perfectly for normal memo text, but when the saved text is RTF, it prints the text and formatting codes just as you see it in the first codebox above.
What I need is a way to print RichTextFormatted text in it's encoded form. Normally I would expect the tPrinter class to have an oPrn:SayRTF( ) capability but that does not exist.
Right now I provide the formatted text in pre-defined fonts, and colors, but that is by section, and that does not give the user the control they would like to do the formatting.
Has ANYONE had success printing an RTF text using the tPrinter class where the other text is all handled by the SayText() method????l
Anyone ???
Thank you for your input.