Beiträge von Cmich22

    OK, i put together two sample projects. You can download the projects, the richtext I am using, and the pdfs I printed out from the following link:


    The wp4 project was written in Delphi 4 using WPTools 4. I then converted the project to Delphi 7 using WPTools 5 and named it wp5. The two printouts (wp4.pdf and wp5.pdf) to the same printer on the same machine and you can see that the page breaks are in different places. Please let me know if you need anymore info from on this.[/url]

    With this in mind, then shouldnt the same richtext on the same machine show the same results between 4 and 5? I posted the richtext below last week for a tab formatting issue, but it shows a similar problem where the line height seems to be different. The richtext was printed on the same machine, to the same printer with the only difference between the two being one was loaded in WPTools 4 and the other was loaded in WPTools 5. However, the bottom line in WPTools 5 is a least 1/2 inch off from the one in WPTools 5. Since our clients use these templates for cutting checks, this 1/2 inch difference causes the templates to no longer have correct positioning. I just need the positioning to be consistent with what it was in WPTools 4. Based on your options listed above, what do i need to have set to mimic the WPTools 4 positioning?

    {\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\swiss\fcharset0 Arial;}{\f1\fnil\fcharset0 Times New Roman;}{\f2\fnil\fcharset2 WingDings;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;}\wptoolsver4\wpprheadfoot0\paperw12240\paperh15840\margl360\margr1886\margt1440\margb1440\headery720\footery720{\*\listtable{\list\listtemplateid19690212{\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc1{\leveltext\'02\'00.;}{\levelnumbers\'01;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc3{\leveltext\'02\'01.;}{\levelnumbers\'01;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc0{\leveltext\'02\'02.;}{\levelnumbers\'01;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc4{\leveltext\'02\'03);}{\levelnumbers\'01;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc0{\leveltext\'03(\'04);}{\levelnumbers\'02;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc4{\leveltext\'03(\'05);}{\levelnumbers\'02;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc2{\leveltext\'03(\'06);}{\levelnumbers\'02;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc4{\leveltext\'03(\'07);}{\levelnumbers\'02;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc0{\leveltext\'03(\'08);}{\levelnumbers\'02;}}
    \listid1194737}}{\*\listoverridetable{\listoverride\listid1194737\listoverridecount0\ls1}}\endnhere\sectdefaultcl{\pard{\tx4860 \qc\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \{M001\}\par
    \qc\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \{M002\}\par
    }{\tx180\tx6480 \qj\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab Name: \{M053\}\par
    }{\tx180\tx6210 \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab SSN: \{M020\}\tab \tab Location: \{M046\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab Branch: \{M045\}\tab \tab Department: \{M047\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \par
    }{\tx180\tx1170\tx3870\tx5220\tx2610 \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab Date\tab Number\tab Amount Paid\tab Amount\tab Description\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \{E101\}\tab \{E201\}\tab \{E501\}\tab \{E601\}\tab \{E401\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \tab \tab \{E701\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \{E102\}\tab \{E202\}\tab \{E502\}\tab \{E602\}\tab \{E402\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \tab \tab \{E702\}\tab \tab \tab \tab \tab \tab \tab \tab \tab \tab \{E103\}\tab \{E203\}\tab \{E503\}\tab \{E603\}\tab \{E403\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \tab \tab \{E703\}\tab \tab \tab \tab \tab \tab \tab \tab \tab \tab \{E104\}\tab \{E204\}\tab \{E504\}\tab \{E604\}\tab \{E404\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \tab \tab \{E704\}\tab \tab \tab \tab \tab \tab \tab \tab \tab \tab \{E105\}\tab \{E205\}\tab \{E505\}\tab \{E605\}\tab \{E405\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \tab \tab \{E705\}\tab \tab \tab \tab \tab \tab \tab \tab \tab \tab \par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \par
    }\ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 Account Balance; Medical Expense: \{M084\}\tab \tab Dependent Care: \{M072\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \par
    {\tx5760 \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \{M009\}\par
    }{\tx8640 \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \par
    }\ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \par
    {\tx5760\tx1440 \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \{M053\}\tab \{M100\}\tab \par
    }\ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \{M101\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 }
    }


    Thanks again,

    Another set of richtext that looks different between WPTools 4 and 5. This one seems to be on when the page breaks occur. Notice on the first page that the pagebreak occurs before the Sincerely, but in WPTools 5, both the {M018} and {M019} get on the page. Also, on page 3, following the forced page break on page 2, the page break for WPTools 4 occurs before the How can you elect continuation coverage? section while in 5 it is after.

    Thoughts?

    The layout is kinda specific since this a template, so the slight differences in line spacing and field placement causes the template to become out of synch. Our customers have been using the templates in WPTools 4 for a few years now and we dont want a move to WPTools 5 to cause them to have to change all their templates.

    The following richtext displays differently between WPTools 4 and WPTools 5.

    {\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\swiss\fcharset0 Arial;}{\f1\fnil\fcharset0 Times New Roman;}{\f2\fnil\fcharset2 WingDings;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;}\wptoolsver4\wpprheadfoot0\paperw12240\paperh15840\margl360\margr1886\margt1440\margb1440\headery720\footery720{\*\listtable{\list\listtemplateid19690212{\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc1{\leveltext\'02\'00.;}{\levelnumbers\'01;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc3{\leveltext\'02\'01.;}{\levelnumbers\'01;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc0{\leveltext\'02\'02.;}{\levelnumbers\'01;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc4{\leveltext\'02\'03);}{\levelnumbers\'01;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc0{\leveltext\'03(\'04);}{\levelnumbers\'02;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc4{\leveltext\'03(\'05);}{\levelnumbers\'02;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc2{\leveltext\'03(\'06);}{\levelnumbers\'02;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc4{\leveltext\'03(\'07);}{\levelnumbers\'02;}}
    {\listlevel\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent720\levelnfc0{\leveltext\'03(\'08);}{\levelnumbers\'02;}}
    \listid1194737}}{\*\listoverridetable{\listoverride\listid1194737\listoverridecount0\ls1}}\endnhere\sectdefaultcl{\pard{\tx4860 \qc\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \{M001\}\par
    \qc\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \{M002\}\par
    }{\tx180\tx6480 \qj\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab Name: \{M053\}\par
    }{\tx180\tx6210 \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab SSN: \{M020\}\tab \tab Location: \{M046\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab Branch: \{M045\}\tab \tab Department: \{M047\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \par
    }{\tx180\tx1170\tx3870\tx5220\tx2610 \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab Date\tab Number\tab Amount Paid\tab Amount\tab Description\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \{E101\}\tab \{E201\}\tab \{E501\}\tab \{E601\}\tab \{E401\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \tab \tab \{E701\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \{E102\}\tab \{E202\}\tab \{E502\}\tab \{E602\}\tab \{E402\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \tab \tab \{E702\}\tab \tab \tab \tab \tab \tab \tab \tab \tab \tab \{E103\}\tab \{E203\}\tab \{E503\}\tab \{E603\}\tab \{E403\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \tab \tab \{E703\}\tab \tab \tab \tab \tab \tab \tab \tab \tab \tab \{E104\}\tab \{E204\}\tab \{E504\}\tab \{E604\}\tab \{E404\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \tab \tab \{E704\}\tab \tab \tab \tab \tab \tab \tab \tab \tab \tab \{E105\}\tab \{E205\}\tab \{E505\}\tab \{E605\}\tab \{E405\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \tab \tab \{E705\}\tab \tab \tab \tab \tab \tab \tab \tab \tab \tab \par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \par
    }\ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 Account Balance; Medical Expense: \{M084\}\tab \tab Dependent Care: \{M072\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \par
    {\tx5760 \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \{M009\}\par
    }{\tx8640 \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \par
    }\ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \par
    {\tx5760\tx1440 \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \tab \{M053\}\tab \{M100\}\tab \par
    }\ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 \{M101\}\par
    \ql\li0\fi0\ri0\sb0\sl1000\sa0 \plain\f1\fs20\cf0 }
    }

    Thoughts?

    Using WPRichText component, if I wanted to select from some paragraph in a document to the end of the document I use the following code:

    FWPRichText3.Memo.Cursor.SelectFromHere(FWPRichText3.ActiveParagraph, 0);
    FWPRichText3.Memo.Cursor.SelectToHere(FWPRichText3.LastPar, FWPRichText3.LastPar.CharCount);

    However, the SelectToHere line is not going to the end of the document. It stops in the last cell of a row where the ActiveParagraph starts.

    Thoughts?

    sorry about the truncation, should have been the line

    if FWPRichText3.Finder.Next('M113') then

    The selection I am trying to copy needs to be from the start of the row and not the finder position. So the first find sets my initial position and the second finds the last. If the second find is on the same line as the first, I dont select the row since it was already selected in the first take.

    What is weird is that for some letters that generate, this code runs just fine. However, for some reason I get a repeatable access violation for a specific letter. None of the pointers are nil and when trying to step into the Next method to try and track it down, I dont seem to have any luck. It will eventually just return a too many continuous errors and then generate the AV.

    Knowing that the AV happens on the Finder.Next, does that still make your comment on the AV creation by use of paragraph references being deleted still relevant? I was more along the thought that I am doing something to move the Finder such that it is in a bad paragraph or something, but I really have no idea.

    With the code below, i getting an AV on the line <<if>> for some letters but not all. I cannot see any difference with the letters that cause AV then with those that do not. I am little stumped and was hoping for a little guidance. I posted the section of code so you can get an idea of what is going on. Any direction to look in would be appreciated.

    Using WPTools v 5.202, Delphi 7.0, on Windows XP.

    Thanks,
    Chris Michalec
    Travis Software, Inc.

    I have some text in a RichText component {B001}. This is just a place holder for text to be merged from another RichText component. I use the finder to locate this text and then grab the font settings using the following code:


    My issue is that for most 'letters' in my system, the FontNr in the first code set is set correctly and everything works fine. However, for some letters the FontNr is coming back as 0 from the CurrentCharAttr. If I load up the letter in the Editor, I can see the font set via the controls as Arial. If I switch to another font, the letter prints fine with the font switched to. However, if I switch back to Arial, the FontNr is back to 0 again. For every other letter, the Arial font is FontNr 2. The 0 causes the font to switch to Times New Roman. Any ideas on where to look?

    Setting the FoundText worked as I needed it. Now one more quick question. If I want to change the Char Attr of this text just added, which Attr would I use? CurrentCharAttr? WritingAttr? Still not sure which one to use when.

    Thanks,

    figured i could go ahead and post a code snippet

    i added the CPPosition at the time of each function call as comment to end of line.
    <----------

    FWPRichText1.CPPosition := nFoundPos; // 804
    FWPRichText1.Finder.FoundText := ''; // 804

    If (cString <> '') then
    FWPRichText1.InputString(cString); // 1130 <why>

    WP Tools 5 v202
    Delphi 7

    I have a WPRichText component with a rich text document loaded. Within this document are tables that looks like

    <c1> <c2>

    <c3> <c4>
    <c3> <c4>

    <c1> <c2>

    <c3> <c4>
    <c3> <c4>
    // note that we are outside of the table now
    <end>

    In trying to replace the <c4> value with some "Text", I use the Finder to locate the text and then set the CPPosition and the finder Position. I clear the text in the cell by clearing Finder.FoundText, and then use InputString("Text") to put in my text. However, for the first c1 cell, the text gets put all the way at the <end> instead of at the Cursor Position. In stepping through this, I can see that CPPosition is correct at the point of the InputString call, but within this function the CPPosition is getting thrown out to the <end>. I tried stepping into the function, but I just get lost in the FMemo.InputString(Text, false) function.

    Thoughts?

    If you need further info let me know, but I am not sure how else to explain it. This is the only case where this happens and all the other cells fill in just fine. Do note that the tables above were added to the WPRichText doc from another Doc and the Initial section with the c1 was added via a Memo.RTFData.Assign from another WPRichText component.

    Consider the follow example:

    I have a 8 X 2 table that has a total of 16 cells and then two lines following this. When I do a use WPRichText1.CountLines, it returns 18 lines. Is there a way to give me a line count such that it counts each row in the table as a line instead of the cell? In the above example, I would expect it to return 10 lines and not 18. This way I can determine how many instances of the above will fit on a page.

    Using WP Tools 5.20.5c

    Thanks,

    What is the best practice for copying a table row of unknown columns from one WPRichText to another? I have tried to essentially track over the selection across my row(s) by starting a SelectFromHere and then setting my position to the end of the row in question and then setting SelectToHere and then using the Selection as string to copy into the other WPRichtText component. However, I would think there would be an easier way to select a row in a table.

    Thoughts?

    I am trying to add a prompt for save dialog on a richtext editor. In the datasource OnDataChange event, i set a flag so that on close of the document or close of the editor, it will prompt the user to save before closing. This works for changing of text, but if you just change the format of the text, the datachange event does not fire. I also tried the onchange event in my DBWPRichText component that the editor uses. Is there an event to catch if the formatting has change so that I can prompt the user to save?

    Thanks
    Chris Michalec
    Travis Software, Inc.