Setting Bold in ppRichText doesn't print
In a prior posting I shown how to get a particular word in a ppRichText
component to be bold. I set it up in the OnPrint method of the ppRichText.
In the print preview it shows the word bolded but not in the actual printed
document.
Below is the code I used. The words (State Names ) to locate are in a
TStringList:
With ppRichText1 do
begin
for I := 0 to slStateList.Count -1 do
begin
if SelLength <> 0 then
iStart := SelStart + SelLength
else
iStart := 0;
iEnd := Length( RichText ) - iStart;
lFoundAt := FindText( slStateList[I],iStart,iEnd,[]);
if lFoundAt <> -1 then
begin
SelStart := lFoundAt;
SelLength:= Length(slStateList[I]);
SelAttributes.Style := [fsBold];
end; // lFoundAt
end; // slStatelist
component to be bold. I set it up in the OnPrint method of the ppRichText.
In the print preview it shows the word bolded but not in the actual printed
document.
Below is the code I used. The words (State Names ) to locate are in a
TStringList:
With ppRichText1 do
begin
for I := 0 to slStateList.Count -1 do
begin
if SelLength <> 0 then
iStart := SelStart + SelLength
else
iStart := 0;
iEnd := Length( RichText ) - iStart;
lFoundAt := FindText( slStateList[I],iStart,iEnd,[]);
if lFoundAt <> -1 then
begin
SelStart := lFoundAt;
SelLength:= Length(slStateList[I]);
SelAttributes.Style := [fsBold];
end; // lFoundAt
end; // slStatelist
This discussion has been closed.
Comments
to the printer. Also, what if you print static richtext that is bold Arial
10 to the printer, instead of setting it in code?
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com