trichview.com

trichview.support




Re: How to change the exported rtf charset?


Return to index


Author

Message

Sergey Tkachenko

Posted: 04/19/2005 0:04:58


procedure ConvertRVFromUnicode(RVData: TCustomRVData);

var i,r,c, StyleNo: Integer;

    table: TRVTableItemInfo;

begin

  for i := 0 to RVData.ItemCount-1 do begin

    StyleNo := RVData.GetItemStyle(i);

    if StyleNo>=0 then begin

      if RVData.GetRVStyle.TextStyles[StyleNo].Unicode then begin

        RVData.SetItemText(i, RVData.GetItemTextA(i));

        Exclude(RVData.GetItem(i).ItemOptions, rvioUnicode);

      end;

      end

    else if RVData.GetItemStyle(i)=rvsTable then begin

      table := TRVTableItemInfo(RVData.GetItem(i));

      for r := 0 to table.Rows.Count-1 do

        for c := 0 to table.Rows[r].Count-1 do

          if table.Cells[r,c]<>nil then

            ConvertRVFromUnicode(table.Cells[r,c].GetRVData);

    end;

  end;

end;


procedure ConvertFromUnicode(rv: TCustomRichView; Charset: TFontCharset);

var i: Integer;

begin

  for i := 0 to rv.Style.TextStyles.Count-1 do

    rv.Style.TextStyles[i].Charset := Charset;

  ConvertRVFromUnicode(rv.RVData);

  for i := 0 to rv.Style.TextStyles.Count-1 do

    rv.Style.TextStyles[i].Unicode := False;

end;


Call:

ConvertFromUnicode(rvreporthelper.RichView, Charset);


Note: this function modifies both the document in reporthelper and styles in

its RVStyle







>

> I would like to ask your suggestion for the problem i am currently facing

> when exporting PDF.

>

> I am using llPDFLib for exporting pdf. After writting asian language in

the

> RVE then try to export it to pdf it cannot work under english locale but

> only speficic language locale. For example, if I write chinese then export

> it under chinese locale it will be fine. I want to leave my rve to remain

> unicode enabled, but when export I want to convert all the content to a

> particular charset before doing any exporting work. From the demo given in

> TRichView website about the llpdflib export. It involves the usage of

> RVReportHelper. Can the reporthelper do what I need?

>

>

> "Sergey Tkachenko" <svt@trichview.com> wrote in message

> news:42611320$1@support.torry.net...

> > Hmm. Changing charsets in TRichView documents has the following effect:

> > 1) If text is not Unicode, the displayed text will be changed. For

> example,

> > if you have Russian text with RUSSIAN_CHARSET and change the charset to

> > ANSI_CHARSET, you'll have meaningless set of Western characters and

> graphic

> > symbolds instead of Russian text. Of course, if the original text of

> > RUSSIAN_CHARSET has only English characters (i.e. all character codes

> <128),

> > nothing will be changed.

> > 2) If text is Unicode, nothing will be changed in display. Unicode text

> > drawing and processing functions do not use charset. TRichView uses this

> > charset only to determine a language of text when converting to to

> > non-Unicode.

> >

> >

>

>





Powered by ABC Amber Outlook Express Converter