WPCubed Product Support

Russian characters in RTF-Preview but not in PDF-Export

support

Hi,

WritingAttr.SetFontCharset command seems only to work in the first row and first column of a table

I see no reason for this to be the case. WritingAttr is used to create the CharAttr index for new text.

You can of course use that once, the store WritingAttr.CharAttr to a cardinal and use this cardinal as CharAttr to insert text, Paragraph.Insert(.., index) for example.

Julian

#4 ♥ 0
7.9k Views 1 links 2 users read 2 min

Hello Julian,

Thanks, now I use WritingAttr.SetFontCharset as you suggested.

[...]
RTF.CPPosition := FoundPosition;
RTF.WritingAttr.SetFontCharset(RUSSIAN_CHARSET);
RTF.InputStringW(UTF8D(Output));
[...]

There is still a problem: The code above is used in a loop which replaces tags within an RTF-document. (e.g. <lastname> ist replaced by Smith). The tags may be organized in tables. The SetFontCharset command seems only to work in the first row and first column of a table, but not in the other columns and rows!
In my code, I only jump to the position of the tag by using RTF.CPPosition:= FoundPosition. Is there anything else I have to do?

#3 ♥ 0
support

Hi,

the export of unicode characters require the new CIDFONT feature intoduced in wPDF 3.
[](http://wpcubed.com/forum/viewtopic.php?t=2512)

Without this you have to specify the charset. CPAttr only changes the charset of one character so you have to use WritingAttr.SetCharset before InputStringW.

Regards,

Julian Ziersch

#2 ♥ 0

Hello,

I can successfully insert russian characters into an RTF-file by using RTF.InputStringW("mytext"). The RTF-Preview shows it correctly, but when creating the PDF-file out of it (via wPDF) the russian characters have all gone (empty output).
I use the current version of wPDF and WPTools5 and Acrobat 7 for viewing.

I tried to initialize the wPDF-class with this:

WPPDFExport.Canvas.Font.Name := 'Arial';WPPDFExport.Canvas.Font.Charset := RUSSIAN_CHARSET;WPPDFExport.FontMode:= wpEmbedSubsetTrueType_Charsets;WPPDFExport.Source := RTF;

I've also tried to set the charset explicitly before inserting the text:

RTF.CPAttr.CharSet:= russian_charset;
RTF.InputStringW(s);

Is something missing?

#1 ♥ 0