Beiträge von JeffKelly

    Hi
    I have a template system that also merges a cover email. I use

    Code
    emailBody := rte.AsANSIString('HTML-nomergefields');


    to convert the rtf to html for the email
    But one user has come up with a format that is not converting well.
    I think that if we could use our own html tags in the rtf editor that would remain as html in the conversion and not be converted from

    Zitat

    <div><font size="2">Here is the text with html aroud it</font></div>


    to

    Zitat

    &lt;div&gt;&lt;font size=&quot;2&quot;&gt;Here is the text with html around it&lt;/font&gt;&lt;/div&gt;


    We would be able to formatt the email better.

    is there a setting for this?

    The problem in format is
    a bullet point plus text followed by a
    cr tab plus text followed by a
    cr tab plus text followed by
    cr two tabs plus text (two lines of this)followed by a
    bullet point plus text.

    What we get after the conversion is this

    • If you are not in New Zealand already, please let us know the time and date of your arrival in Auckland (Albany). Our contact details are:
    Email: xxxxxxxxx@xxxxxxxxxxx
    Telephone: +xxxxxxxxxxxx during working hours 9.00am - 5.00pm Monday to Friday
    New Zealand standard time
    • +xxxxxxxxxxxx in the event of an emergency only outside working hours, or
    while in transit
    • Return your application for a xxxxxxxxxxxxxxx.

    Also the tab is putting in a -0.3in which does not produce a tab in html. Removal of the - makes it work.

    HI
    I have a form (Delphi 7) using WPTools 5 TWPRichEdit with TWPToolBar.
    Also on the form are 4 TDBEdit text boxes.

    If TWPRichEdit has never had focus
    when a TDBEdit has focus Ctrl + V does nothing

    Once the TWPRichEdit has had focus but the focus had returned to the TDBEdit
    Ctrl + V will paste into the non-focused TWPRichEdit.

    Shift + Insert will paste correctly as will popup menu "Paste"
    But the users are used to using Ctrl + V and this behaviour is causing problems.
    If I remove the WPTool controls from the page Ctrl + V works correctly.

    Is there anything I can do to stop this behaviour?

    Hi
    Working great now thanks.
    This is what I have ended up with.

    Code
    img := TWPOImage.Create(aRte);
             img.LoadFromFile(ExtractFilePath(Application.ExeName)+ 'LG_Massey.bmp');
             aRte.CPPosition := 0;
             aRte.InsertPar;
             aRte.CPPosition := 0;
             aRte.TextObjects.Insert(img);
    
    
             aRte.ReformatAll(false,false);

    Hi
    I am trying to add a logo to the letter head when a letter is issuesd as an attachment (pdf format). The PDFExport is working for the text but no image appears.
    What i am trying to do is add the image to the TWPCustomRtfEdit. Then export as usal

    Code
    img := TWPOImage.Create(aRte);
    img.LoadFromFile('LG_Massey.bpm');
    aRte.TextObjects.Insert(img);
    aRte.Refresh();
    pdfExport.Source := aRte;
    pdfExport.Print;

    Can you tell me how to get the image to appear at the top of a letter that is then saved as PDF?

    I have opened this image in MSPaint and copied and pasted it into a letter manually and can get it to save. But I need to do this in code.

    TIA

    Jeff

    Hi Julian
    The users want to have a mail merge field removed when emailing a letter but want it there if printing.

    Some times the one letter will be printed then email of visa versa.

    What is the best way to hide a merge field in a temproary way. It would be good to hide the seemingly empty space as well. Then if the issue method needs the merge field I can show it again.

    TIA

    Jeff

    Hi
    I am having problems with the color table definition changing.
    This is causing text to disappear
    In the template for the letter the following is in the rtf header
    {\colortbl\red0\green0\blue0;
    Saved from the TWPRichText component

    After the letter is mail merged the rtf header looks like this
    {\colortbl\red255\green255\blue255;
    Saved from the TWPCustomRtfEdit.CreateDynamic server object

    So any font with a \cf0 turns white and disappears.

    When I look at the code to write the colortbl there is set no order. How can I stop this happening. We have 15,000 letters where this is a problem.

    A little desperate
    Jeff

    Removing all background colors does solve this particular problem.
    And because some versions of Outlook seem not to respond to back.color style. It will do for now. However, some users say they want font background for emphises, with the hope that MS fixes the bug in Outlook
    There is a bug in WPIOHTML.TWPHTMLWriter.UpdateCharAttr
    that is converting \cb0 to background.color:black.
    In debug -
    if FCharAttr.GetBGColor(aColor) line 1383
    returns aColor of 0
    and WPColorToString(aColor) returns black
    the is what FCharAttr looks like for cb0
    ((358, (0, 1, 1000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0)), False, (0, (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)))
    here is what FCharAttr looks like for cb15 which is font background color = black - also using font color = white
    ((390, (0, 1, 1000, 0, 0, 0, 0, 12, 15, 0, 0, 0, 0, 0, 0, 0)), False, (0, (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)))

    FCharAttr.GetBGColor(aColor) is grabing correct attribute.

    I think the problem is in where clBlack is defined twice. the First one should be clNone line 587 in unit WPRTEDefs

    Code
    WPStandardColors: array[0..15] of TColor =
      (clBlack, clRed, clGreen, clBlue, clYellow,
        clFuchsia, clPurple, clMaroon, clLime, clAqua, clTeal, clNavy,
        clWhite, clLtGray, clGray, clBlack);

    This is used in TWPRTFProps.Init to fill the array FPaletteEntries.

    What do you think?

    Hi
    I'm having a problem when i convert RTF to HTML and sending the result in the body of an email. I use the method
    emailBody := rte.AsANSIString('HTML-nomergefields');
    We set the mime type in the email to html
    We are getting parts of the email blacked out. In View Source I find:

    Code
    <div style="text-align:justify;"><span style="background.color:black;"><font size=2>We have made the following changes in order to process your enrolment.</font></div>

    Looking at the RTF I can see not reason for this

    Code
    These papers are not available for the following reasons:\par  \pard\plain\qj\plain\fs20\par  \pard\plain\qj\plain\fs20\cb4\i\par  \pard\plain\qj\plain\fs20\par  \pard\plain\qj\plain\fs20\par  \plain\fs20\cb0 We have made the following changes in order to process your enrolment.\par  \pard\plain\qj\plain\fs20\cb4\par  \tx1694\tx3402\tx5129\plain\fs20 Paper\tab Semester\tab Location

    Some versions of MS Outlook black out the enclosed text other versions ignore it and so you can see the text
    Can you help with this.[/code]

    Hi
    I am having a problem writing large PDF files.
    I am trying to write a two page letter for 5000 students. Each letter is added to a PDF file using WPPDFExport.Print.
    After about 4800 writes to the file I get the following error.
    Canvas does not allow drawing

    I think the problem is that the Method TWPDFEnhMetafile.BeginDraw
    has the code

    Code
    if RefDC = 0 then
          dc := GetDc(0)
        else dc := RefDC;
        try
    BUT THEN
        finally
          if RefDC <> 0 then
            ReleaseDC(0, dc);

    So the DC resorce is not released.
    What do you think?
    Is this the problem or is there something else I sould be doing?

    Thanks in advance

    Jeff

    Hi
    I am trying to insert images into letter template with

    What I need to know is how can I change the 1440,1440 into the correct size for the picture. I can see the OpenPictureDialoge displays this but I can not find how to do this?

    Can you help?

    Hi
    We have just purchashed a single licence to wpPDF plus to allow us to evaluate it. But we have a show stopper problem. I have previously sent this to 'support@wptools.de' but have not had a reply. Can this forum help?

    I am trying to add PDF exporting to wpTools5 But I can not get it to run – I get an AV from WPPDFWP.TWPPDFExport.PrintPages (Line 235, "WPPDFWP.pas")
    This line is –
    // V2.60 - new way to read page size
    w := MulDiv(FSource.Memo._PaintPages[i].WidthTw,WPScreenPixelsPerInch,1440);

    I have added this code to our server side letter generation which is build on TWPCustomRtfEdit.

    Code
    procedure TLTGNEmailLetterIssue.SaveAsPDF(aRte : TWPCustomRtfEdit; aFileName : string);var   pdfExport : TWPPDFExport;begin   try      pdfExport := TWPPDFExport.Create(nil);      try         WPDF_Start(The confidential stuff you sent us );         pdfExport.Source := aRte;         pdfExport.Filename := aFileName;         //pdfExport.FontMode := wpEmbedTrueTypeFonts; // only do this if going to the printery not if emailing as attachment        // pdfExport.Encryption := [wpEncryptFile,wpEnablePrinting];           pdfExport.Print;    // this is line 430      finally         FreeAndNil(pdfExport);      end;      if not FileExists(aFileName) then         raise Exception.Create('Failed to save PDF file ' + aFileName);   except      on e: exception do      begin         e.Message := 'TLTGNEmailLetterIssue.SaveAsPDF' + #13#10 + e.Message;         raise;      end;   end;end;

    The stack dump on error is

    [009F70F5] WPPDFWP.TWPPDFExport.PrintPages (Line 235, "WPPDFWP.pas")
    [004049EE] System.@HandleFinally (Line 10065, "system.pas")
    [009F6FF3] WPPDFWP.TWPPDFExport.PrintPages (Line 216, "WPPDFWP.pas")
    [009F700A] WPPDFWP.TWPPDFExport.PrintPages (Line 218, "WPPDFWP.pas")
    [004041C7] System.TObject.NewInstance (Line 8360, "system.pas")
    [00402C1A] System.@GetMem (Line 2439, "system.pas")
    [009F3D83] WPPDFR1.TWPCustomPDFExport.SetFileName (Line 875, "WPPDFR1.pas")
    [009F6F2A] WPPDFWP.TWPPDFExport.Print (Line 181, "WPPDFWP.pas")
    [009FA3D7] UnitLTGNEmailLetterIssue.TLTGNEmailLetterIssue.SaveAsPDF (Line 430, "UnitLTGNEmailLetterIssue.pas")
    [009FA480] UnitLTGNEmailLetterIssue.TLTGNEmailLetterIssue.SaveAsPDF (Line 440, "UnitLTGNEmailLetterIssue.pas")
    [009FA0D8] UnitLTGNEmailLetterIssue.TLTGNEmailLetterIssue.extractAttachedLetters (Line 382, "UnitLTGNEmailLetterIssue.pas")
    [009F9253] UnitLTGNEmailLetterIssue.TLTGNEmailLetterIssue.SendEmailLetter (Line 152, "UnitLTGNEmailLetterIssue.pas")
    [009FDC1C] UnitDMLetterGenerator.TDMLetterGenerator.aaiIssueEmailLetterOnAction (Line 1138, "UnitDMLetterGenerator.pas")

    In debug I get to line 235 WPPDFWP.TWPPDFExport.PrintPages and inspect
    w := MulDiv(FSource.Memo._PaintPages[i].WidthTw,WPScreenPixelsPerInch,1440);
    I get something for FSource.Memo
    (nil, '', 0, nil, nil, 0, [], nil, [csInheritable], nil, $535EC70, 0, 0, 0, 0, [csCaptureMouse,csClickEvents,csSetCaption,csDoubleClicks], [], False, True, True, True, True, alNone, False, dmManual, False, bdLeftToRight, True, [akLeft..akTop], False, nil, $535F230, nil, -16777211, $535F258, 0, -12, nil, '', 0, (0, 0), (0, 0), [], False, True, dkDrag, doNoOrient, nil, 0, 0, 0, 0, 0, TCustomDockForm, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, htContext, '', 0, $535F27C, False, [], [], wpspCheckInInit, nil, nil, $535B5C0, nil, wpIsBody, wpraOnAllPages, '', '', '', [soAllStylesInCollection..soWriteObjectsAsRTFBinary], False, [], (100, False, False, False, False, False), nil, [], [], 0, [wpTableResizing,wpTableColumnResizing,wpObjectMoving..wpObjectDeletion,wpSpreadsheetCursorMovement,wpActivateUndo..wpActivateUndoHotkey,wpMoveCPOnPageUpDown], [], [], 'AUTO', 'AUTO', '', $5362340, nil, True, $5375568, False, 0, $53633A4, nil, 1252, False, False, 0, nil, nil, False, $535B5C0, $535B5C0, $535B5C0, False, False, False, False, 0, False, nil, $535B5C0, 0, 0, 0, 0, -1, 0, 0, '', (0, (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), 0, False, False, False, False, 0, 0, [wpobjMergeField..wpobjHyperlink], $535F370, nil, nil, nil, $535F3DC, 0, False, False, False, ((0, 0, 0, 0, (0, 0), (0, 0)), (0, 0, 0, 0, (0, 0), (0, 0)), (0, 0, 0, 0, (0, 0), (0, 0)), (0, 0, 0, 0, (0, 0), (0, 0)), (0, 0, 0, 0, (0, 0), (0, 0)), (0, 0, 0, 0, (0, 0), (0, 0)), (0, 0, 0, 0, (0, 0), (0, 0)), (0, 0, 0, 0, (0, 0), (0, 0)), (0, 0, 0, 0, (0, 0), (0, 0))), 0, 0, 0.5, 0.5, wpNoFrameLine, 0, 0, 0, 0, nil, False, False, False, nil, nil, nil, nil, nil, nil, $535B5C0, nil, nil, nil, nil, False, 0, 0, 0, 0, 1440, 2000, 96, -16777211, -16777200, 0, 0, 15908791, nil, nil, False, 144, 144, 144, 144, 200, 100, 1, $535B5C0, wpAutoZoomOff, 1, 1, wplayFullLayout, True, 0, 0, 0, 0, [], 0, 0, False, 600, 600, [], 1, 1, 0, False, [], [], 0, False, -1, $5362088, $536209C, 0, 0, 0, 0, nil, 0, 0, 0, 0, False, False, False, F

    In wpdf_inc.inc I have

    Code
    // This define MUST be enabled. It switches the use of the wPDF DLL on
    // If you have wPDF PLUS or the InterNet server edition please
    // disable this $define
    
    
    {$IFNDEF WPDFPLUS}
    (*{.$DEFINE INTWPSWITCH} // wPDF Standard: ON  - wPDF PLUS: OFF   *)
    {$ENDIF}

    What am I doing wrong?

    Great - works fine

    Hi
    Is there an easy way to remove a mailmerge field from a template when the user deletes any part of the visible part of the field?

    I have found that the field still exists and is picked up in the

    Code
    rtEdit.FieldGetList(fieldList,true,'');


    method which means that some of our processing is still being performed on these fields.

    Hi
    I need to print to various networked printers from a centrel multi threaded server.

    We are generating bulk letters on a background server - inside a background job runner. We are using your thread safe TWPCustomRtfEdit

    Can I set the printer for a single instance of TWPCustomRtfEdit while another thread is prining to a different printer? How?

    Or how best to do central printing?