trichview.com

trichview.support




Re: Creating PDF with Unicode characters


Return to index


Author

Message

Sergey Tkachenko

Posted: 04/03/2004 18:25:02


// internal procedure

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;


// main procedure

procedure ConvertFromUnicode(rv: TCustomRichView);

var i: Integer;

begin

  // forcing using the default code page

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

    if rv.Style.TextStyles[i].Unicode then

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

  // converting

  ConvertRVFromUnicode(rv.RVData);

  // updating styles

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

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

end;


Calling for editor:

RichViewEdit1.ClearUndo;

ConvertFromUnicode(RichViewEdit1);


>

> hello,

>

> i have some problems creating pdf.

> Since no tool (TRolePDF, llPDFLib, wPDF, eDocEngine) can handle all

unicode

> characters correctly, is it possible to change unicode characters in

Ansi-characters

> with corresponding charset in RVReportHelper? (then it would be possible

> to use wPDF or maybe llPDFLib) i know this would be only a solution for a

> few characters, but for the most characters i need.

>

> Or has somebody another solution to create PDF that handles unicode

correctly?

>





Powered by ABC Amber Outlook Express Converter