Hello
Our company likes to purchase your components in order to integrate them into existing programs. Presently, we use standard components which allow us to display and modify RTF text.
* We like to know whether it is possible to print a text part into a canvas and to know the number of lines or characters wich are really printed into this canvas.
* How the 'Wordwrap' is managed if the width of canvas used is less than the width of Trichview component?
* Does an event exist that is able to detect the wordwrap ?
* Can we use a dictionary of hyphenation? (Word cut at wordwrap)
Presently, we use in our programs a code like the following one:
SendMessage(ARichedit.Handle, EM_FORMATRANGE, 0, 0);
FillChar(Range, SizeOf(TFormatRange), 0);
Range.hdc := ACanvas.handle;
Range.hdcTarget := ACanvas.Handle;
Range.rc.left := ARect.Left * 1440 div Screen.PixelsPerInch;
Range.rc.top := Arect.Top * 1440 div Screen.PixelsPerInch;
Range.rc.right := ARect.Right * 1440 div Screen.PixelsPerInch;
Range.rc.Bottom := ARect.Bottom * 1440 div Screen.PixelsPerInch;
Range.chrg.cpMax := ToChar;
Range.chrg.cpMin := FromChar;
Result := SendMessage(ARichedit.Handle, EM_FORMATRANGE, 1, Longint(@Range))
SendMessage(ARichEdit.handle, EM_FORMATRANGE, 0,0);
Thank you.
EUROSOFT PLUS S.A.S.
Romuald Kler
Tel.: +33 3 87 84 71 85
Fax: +33 3 87 84 23 95
E-Mail: [email protected]
http://www.eurosoft-plus.com
Question about Trichview
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
1) There is no direct analog of EM_FORMATRANGE. TRVReportHelper component is used to draw document on a Canvas. You can specify width and height(s) of the output rectangle(s), but you cannot specify a range of characters to print. May be you can explain the problem with more details, and I'll try to suggest a solution.
2) Line wrapping can be turned off for the whole component (WordWrap = False) or for the specified paragraphs. If wrapping is allowed, it is different for ANSI and Unicode text. For ANSI text, lines wrap on space characters. For Unicode text, advanced line wrapping rules are used (for example, never break before ")", but can break after, etc.).
The newest version available for registered users has a better line wrapping algorithm than the trial version (the trial version likes to break between text of different font, even inside a word).
3-4) If a word is too long to fit into the line, it is wrapped in any place. Sorry, no hyphenation rules or events can be used in the current version,
2) Line wrapping can be turned off for the whole component (WordWrap = False) or for the specified paragraphs. If wrapping is allowed, it is different for ANSI and Unicode text. For ANSI text, lines wrap on space characters. For Unicode text, advanced line wrapping rules are used (for example, never break before ")", but can break after, etc.).
The newest version available for registered users has a better line wrapping algorithm than the trial version (the trial version likes to break between text of different font, even inside a word).
3-4) If a word is too long to fit into the line, it is wrapped in any place. Sorry, no hyphenation rules or events can be used in the current version,
-
- Posts: 3
- Joined: Tue Jun 29, 2010 9:47 am
The component Trichview will be used in a printing label program.
Here is an example :
I have a text in a trichview. The text has several lines. I need to print the text in a first canvas that is for example 300 pixels width and 400 pixels height. The entire text can not be printed in the canvas because the canvas is too small.
I will wish to print the rest of the text in another canvas. So I need to know how much character or line have been printed in the first canvas.
Is there a feature or a method that can do?
Thank you for your reply
Here is an example :
I have a text in a trichview. The text has several lines. I need to print the text in a first canvas that is for example 300 pixels width and 400 pixels height. The entire text can not be printed in the canvas because the canvas is too small.
I will wish to print the rest of the text in another canvas. So I need to know how much character or line have been printed in the first canvas.
Is there a feature or a method that can do?
Thank you for your reply
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
With TRVReportHelper, you can do it very simple: you can separate document into several "pages" 300x400, even without knowing how much characters are on each "page". Each such "page" must have the same width, but can have different heights. In order to draw the specific page, you just need to specify its index.
Example:
helper: TRVReportHelper, document is loaded in helper.RichView.
Example:
helper: TRVReportHelper, document is loaded in helper.RichView.
Code: Select all
// preparing
helper.Init(Canvas, 300);
while helper.FormatNextPage(400) do;
// drawing
for i := 1 to helper.PagesCount do begin
...
helper.DrawPageAt(Left, Top, i, Canvas, False, 400);
end;
-
- Posts: 3
- Joined: Tue Jun 29, 2010 9:47 am
Ok, it should work in most cases. But, my canvas have sometimes different widths. Example :
canvas1 Width 300pix, height 400 pix
canvas2 Width 400pix, height 200 pix
My labels contain several text boxes. If the first box does not display the entire text of Trichview, the program will print the rest in another text boxe (perhaps with different sizes.)
Is that possible?
canvas1 Width 300pix, height 400 pix
canvas2 Width 400pix, height 200 pix
My labels contain several text boxes. If the first box does not display the entire text of Trichview, the program will print the rest in another text boxe (perhaps with different sizes.)
Is that possible?