Beiträge von darren

    Thanks for the info. I am referring to merge fields and that code from 4 does work. I don't see a CodeGetList, but I do see a FieldGetList, which is what I have been trying to use. If I delete the parent paragraph, that will also delete other fields that are not blank. I am continuing to look at this, but to be clear, yes we are using merge fields. Sometimes the merge field ends up blank and is all by itself on a line. It is in those situations where we are trying to delete that line. We will move to the newest version, but am trying to get 4 to work with 7 for now.

    FYI, here is an example of the lines from 4:

    #9#9'Some Type of Number <ABC<1234567890'

    '<123 A.B.C. BLVD.'#$A

    '<'#$A

    This is the CPLine after I do a find on '<'. I delete the CPLine on the 3rd example.

    I have been able to do most of this by finding the fields, checking to see if cpline has a return only, if so, I blank out CPLine. That works for most, but I have some where I have a field to the right of other text in 2 different cells in a table where the text in the left column is blank also that gets deleted in WPT4 with TWPRichText.RtfText.DeleteLine. I will keep working on this, but if anything I said does not make sense, please enlighten me.

    Thanks again!

    In WPT4, we located and deleted lines if the line was blank due to a field being blank. I need to replicate this in 7, but am having a difficult time doing that. Here is the code in 4 (verify finds the position of the first char that is not in the substring after it, so first one that is not blank or <):

    AllRTFText.Finder.Wildcard := '*';

    AllRTFText.Finder.ToStart;

    AllRTFText.CPPosition := 0;

    NotDone := AllRTFText.Find('<',false);

    while NotDone do

    begin

    VIdx := verify(trim(AllRTFText.CPline),' <');

    if (VIdx = 0)

    or (AllRtfText.CPLine = #10)

    or (AllRTFText.CPline = #13)

    or (AllRTFText.CPline = #10 + #13) then

    AllRTFText.RtfText.DeleteLine;

    NotDone := AllRTFText.FindNext;

    end;

    Thank you! That worked for me.

    I have one other odd scenario with bullets. The rtf has a list of bulleted items. The first bulleted line is bold. The bullet for that line does not display, but the others do. The font looks to be "Symbol", so I guess the bullet would be Symbol, Bold. I have tried all kinds of combinations and manipulating the rtf, but it always results in a "blank" display when the first letter of the line following the bullet is bolded. The text itself is Arial 11.

    Any thoughts would be greatly appreciated.

    Thanks again!

    I have a situation where a letter contains bullets that are wingdings. If I create the pdf from the existing rtf, with the fontmode wpEmbedSubsetTrueType_UsedChar, the bullets are empty boxes. If I use about any other embed option, the bullets come out correct. I would like to use the UsedChar option because of the smaller resulting file size. Using WPDF2, the resulting pdf has the correct bullets with UsedChar. The WPDF2 file size is the same size as one created with wpEmbedTrueTypeFonts; so maybe that is why it is generating it correctly.

    Any thoughts?

    Thanks

    I am trying to delete a line from the rtf under certain circumstances. In 4, I used .rtftext.deleteline once I was on a line that I wanted to delete via find(). What would the equivalent be in 7?

    Thanks

    Yes, it is inserting the page break fine. The problem is that whenever I use #12, it not only inserts a page break, but it also causes the next page to begin further from the top than the first page. So pages 2-the end start about 1 line further down the page than the original first page.

    Lastly, this is code that I am converting from WPTools 4 to 7. It worked in 4 by breaking without the top of the text moving down on subsequent pages. I had to make some changes to handle 7, but this bit is pretty close to the same.

    I am handling a mail merge by loading a template into one wprichtext, merging, then appending that to a second wprichtext. After the first page, in the first textbox, I am moving to position(0,0,0,0) and adding inputstring(#12). This works for page breaks, but it appears to move the text down one line. So, the first page is set, all other pages look identical but are pushed one line down. What is the best way to handle this?

    Thanks

    I am attempting to merge multiple templates into one rtf. For an example, I have 2 templates, templates A & B.

    I have 2 TWPRichText components. I load one with a template A, merge some fields, then fastappendtext it into another TWPRichText component. I then load template B into the first richtext, merge some fields and fastappendtext it into the second TWPRichText component.

    This is resulting in one line being pushed to a second page, or just blank pages sometimes. If I merge all of my data for Template A by itself, or Template B by itself, all is fine.

    Is there a way to merge two different RichTexts into one RichText without loss of their individual properties? Each template is loaded/merged fine, when they are fastappendtext'd, they end up slightly different.

    What affect does calling fastcopyproperties have? If you call it after each merge, would it change the entire document's properties, or just that page?

    Any help is appreciated. Thanks!

    It appears that running under a webservice produces different pdf renderings depending upon the user that the webservice is running under.

    I was able to create a pdf that was perfect when run under one user, but was off when run under the default user.

    Can you tell me what about different user accounts could cause this? For example, is there some permission on a user that might affect the font size or choice differently for different users?

    I ran one last test. I created a console applicaiton to create the pdf from the rtf. I then had the webservice execute the console application. When I run the console application by itself, the pdf is fine, when it runs via the webservice, pages overflow. It appears that when executed via the webservice, the pdf font is slightly different than when run in a standard application.

    I am getting out of my comfort zone with this, so any help would be appreciated.

    In an attempt to discover the problem, I have installed the demo version of wptools 5 and the demo version of wppdf 3. After doing this and changing no other code, now both the stand-alone executable and the webservice produce identical pdfs. However they both cause 1 page (the same in both cases) to run-over into another page where as wptools 4 created the pdf perfectly in the stand-alone application, both with pdf 2 and pdf 3.

    Any help would be appreciated.

    After looking further, it looks like the pdf generated from the webservice has slightly larger spacing in regards to the the distance between letters/words. It is hard to tell if there is any increase in space between lines. But the extra space between words is enough such that it can cause an extra line to be created and push the text onto the next physical page.

    Both the stand-alone app and the webservice are running on the same machine.