Beiträge von JazzMan

    Happy Birthday to a product better than sliced bread! Happy Birthday, Sweet 19!

    Truly, not enough praise can be bestowed upon WPTools, as a product, as (legendary) support offered, or the company. I have never worked as comfortably with, nor had as such a STRONG (well-earned) belief in, the sheer quality and elegance of someone's software.

    I've been fortunate to be using it since the double diskette version, back in Jan 1999. Still have those diskettes!

    Sigh.... Last year as a teenager.... Oh how quickly these programs grow....

    Everybody should know your name,
    You in the Coders Hall of Fame!

    Appreciatively,
    richard diamond

    Folks,

    I'm glad you found the solution to your problem. Well done!

    In case you missed it, the folks at WPTools announced the office would be closed (for vacation) the first couple of weeks in September.

    If you're new to the WPTools line of products, welcome aboard..:) I'm sure you'll find their responsive much more timely when they're not on vacation...;-). I've found that when they do NOT respond, it's always worthwhile to check the Announce forum.

    Regards,
    richard diamond

    This is one possible approach, although it may be the long way around the block...

    In effect you take the contents of the first TWPRichText component and do a "pre-scan" reading the document paragraph by paragraph into a second "destination" editor.

    Starting at the top of the "source" editor copy the non-conditional paragraphs from the source editor into the "destination" editor. So far, straightforward.

    Okay, you've now come upon a "conditional" field indicator. If it's true, copy the paragraph(s) until you come to the false field indicator. Set a flag in your code that tells you as you continue reading paragraphs from the source document until you come to the end of the false section. Reset that internal flag, and resume the paragraph copying.

    Conversely, if that initial conditional field check isn't true, then set the internal flag to skip all the paragraphs in the "If true" section, read through until you come to the false section, then start the copying over. Come to the end of the false section? Reset the internal flag.

    You've now pre-processed the whole document, run the mailmerge on that destination document.

    Hopefully my description of the process as I see it makes sense AND applies to your situation and needs.

    Regards,
    richard diamond

    Forgive my jumping in here. I think the office is closed for a couple of days, so I'll give this one a shot.

    I think what you're looking for is the SetOptions method. Supply the "-dontfixattr" parameter to that:

    Code
    YourEditor.SetOptions('RTF-dontfixattr');


    You might also want to check out TextLoadFormat. This one takes a string argument as well:

    Code
    TextLoadFormat := 'RTF-dontfixattr';


    Check out https://www.wpcubed.com/manual/formatstrings.htm for an up-to-date list of possible format options!

    I hope this helps point you in the right direction.

    Oh, and my customary disclaimer here: I *hope* (and believe), this is right, but I look to Julian to correct any misstatements I make, or point out cleaner ways.

    Regards,
    richard diamond

    Bobby,

    Think of Version 6 as a superset of Version 5, adding to the procedures and general approach you've gotten comfortable with in V5, rather than having to rewrite or replace them - as we experienced in the migration from (in my case) V3 to V5, or (in your case) V4 to V5.

    For the record, I've experienced noneof the issues going from V5 to V6 that I had in the migration to V5.

    Regards,
    richard diamond

    Michel,

    Until Julian responds with what is sure to be a more correct and / or elegant response, see if this helps.

    Since you say you already have the TWPTextObject, you can take advantage of its Wrap property:

    Code
    procedure SetTextObjectProperties( ImageTextObj : TWPTextObj );begin   with ImageTextObj do begin          PositionMode :=  wpotPage;          relx := 0;  // you might want to change this          rely := 0;  //and this one as well          Wrap := wpwrNone;       // what the heck, I felt like throwing the next line in          Mode := Mode + [ wpobjObjectUnderText ];   end;end;


    Alternatively, you can set the Wrap property once for ALL TWPTextObjects:

    Code
    WPRichText1.TextObjects.DefaultWrapMode     := wpwrNone;


    Hopefully that points you in the right direction.

    Regards,
    diamond

    Luke,

    Greetings..:)

    I might be missing something glaringly obvious to everyone ELSE in your sample code, but nowhere did I see what I was expecting to see in your code:

    Code
    RTFDocument.Header.Landscape := TRUE;


    Have you tried that? The statement can go just about anywhere, although near the top, where you initialize the document (but probably after any Clear).

    That do you? And apologies if I'm not understanding your question!
    richard diamond

    For anyone curious about the TextBox feature in WPTools Premium, Julian's implementation of it is nothing short of phenomenal. It stands on its own strength. It opens up endless possibilities.

    For example, by combining text boxes with the SuperPrint module, my company is able to produce professional-quality multi-page booklet brochures. The text boxes are positioned precisely (and column-sized) to overlay on top of pre-printed 11 X 17 paper (with artwork already on the paper).

    Within the program, when the brochures are being created, their edits are done directly in text boxes that can be moved and resized. The screen "background" consists of a scan of the paper, artwork and all, so they know exactly where to place and how to size the boxes.

    That eliminates the endless edit, pray, print, reposition the text, pray some more, print again, kill some more trees (and use up rather expensive paper).

    All this could only be accomplished with Julian's TextBox feature in the Premium bundle!!!

    richard diamond

    (Julian, if this is off-topic, or felt inappropriate, please delete it. My feelings won't be hurt!)

    Frank,

    Pardon my stepping into the middle of this, but have you had the opportunity to look into the product VCLSkin? Unless you have a lot of vested interest, time, money, and code into Developer Express Skins Library, you might want to check VCLSkin out!

    Like WPTools, it's a native Delphi app, and comes with source code (although I've only had to make one change to it, ever).

    I'd researched a number of skinners (including, of course, TBX). It allows you to skin your application(s) with almost NO changes to it - other than dropping its component into your app.

    I've used it for a few years quite happily, and the guy definitely keeps the product current, and addresses any problems brought up. He also makes available, at no cost, additional skins from time to time (as well as giving you an editor that lets you create your own, or tweak existing ones). It's not expensive at all.

    Regards,
    richard diamond

    p.s. AND NO, I have ZERO connection with that company, its product, or the developer!!!

    Julian,

    Thanks for the suggestion! You've mentioned it in the past to me, but I didn't try it because I wasn't sure it fit my particular situation.

    I have the image repeating within the SAME (and ONLY) document when I output to PDF, rather than between different employees in the same print run - that's why I wasn't clear using WPPDFRun, and incrementing it, would apply here. Do I increment it after each inserted image within the SAME document, or was it intended to be incremented between submitted documents in the same print run?

    For me, it's not a case of printing a merged document for a number of employees, and the images repeat among the different employees, but rather when I print a merged document for just a SINGLE employee in the print job, the last image I insert into the document (at run time), is the one that gets repeated.

    If I do a preview or send output to printer, everything's perfect. This is only with PDF output (using V2 of PDF), and WPExportEMFAsBitmap set True.

    I can consistently reproduce this effect with a document containing just a few carriage returns, two images I insert at runtime, an embedded image in the footer, and an embedded form feed (recall I sent you that document).

    Thanks!

    diamond

    I saw something similar in my application. I have no solution, only some questions for you:

    o do you happen to have

    Code
    WPExportEMFAsBitmap := true

    in your code?
    o is your document more than a single page?
    o is there a graphic in your header or footer?
    o Do you have Header/Footer set to something other than "First Page Only"?

    With all those conditions true for myself, I also get a repeating image where there should be a different one. In my case, change any of the conditions, and the problem goes away.

    diamond

    Folks, pardon my jumping in midstream, I hesitate to, since Julian didn't suggest this himself, but.... <hop>....

    Sascha, have you tried FillRect instead of FloodFill?

    Code
    //Fill it red
    PDF.Canvas.CopyMode := cmSrcInvert; //(probably not needed in your case)
    PDF.Canvas.Brush.Style := bsClear; // (bsSolid might be more appropriate for you; it's Brush.Style's default value)
    PDF.Canvas.Brush.Color := clRed;
    PDF.Canvas.FillRect(Rect( 10, 10, 500, 500 )); //Create and fill the Rectangle


    No guarantees (what IS in life?!), but it's worth a shot.

    Regards,
    richard diamond

    Gentlemen,

    I might be misunderstanding the question, but is there a reason you don't use the View As Text option within Delphi to do this for you?

    It seems to me you can choose this option, do a <Ctrl>, <Ctrl>, then open up a WordPad or Notepad session and <Ctrl> into it.

    Regards,
    richard diamond

    My guess is this (the code snipppets) would be of interest to quite a few WPTools 5 users... it opens up possibilities not necessarily available otherwise - such as the embedding of Word Art you mention, or some of the Microsoft Charting abilities.

    Regards,
    richard diamond

    I have zero to contribute to this post, other than.... the FB reference to Ben Stein has to be the FUNNIEST darn thing I've read in a forum in a LONG time...

    LOL!

    richard diamond

    Michael,

    As with all my responses here, I'm issuing a blanket disclaimer: Until Julian gives the _CORRECT_ answer, this may well not be the best way, or even the answer to your question, but feel free to give it a try!


    I hope this is of some help to you.

    Regards,
    richard diamond

    I'm happy you got it going, that's great..:)

    However, something doesn't seem right. You shouldn't have to do any of that hoop-jumping, at all. There should be no Version 4 dependencies, be it WPTools4D[x]_RT.dcp or anything else V4-related, either in the demo or the licensed version.

    I'm wondering what interaction might be going on to cause this on your machine...

    Regards,
    richard diamond