Posts by andi

    Is it possible to highlight all founded text in a document?

    by the way, i would like to highlight more than one word, because i search with an external tool, and would like to open the WPEditor and mark all words which i search and found in the editor?


    Yes its very curious.
    I just tested it on one PC - the Message WM_WPTOOLSUPDATE is sent and received,

    I set a variable to now in the procedure TWPCustomRtfEdit.WMWPTOOLSUPDATE ... and checked it.. everty time i enter a char, this variable has been updated, but i see no text on the screen - if i execute ReformatAll manually than i see the text!

    I allray changed the Value of the WM_WPTOOLSUPDATE.

    And yes the component is on a PAgeControl, but an other form, has the same effect - and this window have no PageControl on it.

    I have a DebugText of same vars in this procedure ... maybe you can say something ....

    fNowDestroy: 0 wParam: 5 lParam: 0, InWaitForPAintEditor: 0 IsDynamic: 0 Locked: 0

    But waht i didn't understand with this explanation.

    It is one application
    with 1 form
    i open this form 5 times (with differnt Text data) all WP Editor works
    i open 2 additional forms - they don't work - ReformatAll works (but i have to execute it every time)
    the first 5 forms works perfect.
    i close the first 5 woking forms
    the 2 forms i opened and was not working - are still not working.

    So just checked it...

    I open 6 Forms with a WPEditor on every form .... all 6 Editors works fine
    the 7th editor which i has opened is not working.
    Closing the 6 working Editors ... and let the not working editor open - it still not working.
    It means i can enter chars on the first line, and i can see these chars ... if i get a line wrap i didn't see anything.
    Or if i click on an other line and change there some chars - i didn't see the change.

    If i call a ReformateAll - I can see all my changes. But all changes i make now i can'T see still i make an additional ReformatAll.

    And the first editor i have opened is working.
    If the editor is loaded and showed on form creation ll works. If the Editor is empty on form create (by the way not really empty but no painting occurs) it didn'T get working regardless if i close 5 other editors.
    And if i have Microsoft office application running - i can't create fewer WPEditor.

    If i execute my application twice - every application can execute for example 6 working Editors.


    I just compiled PDFEdit (i only changed some of the unit name VCL.Windows to windows) and removed the InputQuery - because they have wrong parameters for Delphi2007.

    I can open the pdf but the font isn't look as good as Adobe oder the precompiled PDFEdit.exe from yout package.

    What is wrong?

    ok i will check it on monday (some user in our company have the same problem) - but i think it has nothing to do qith messages and idle time ----

    As far as i know i have allready a ReformatAll in my open process ....

    - with check the content - do you mean a Editor.SaveToString?

    I don't think that the Editor is "empty" - i think that the painting isn't working

    I try to post on monday a picture how the editor looks in this state ...


    It's hard to describe the problem ...

    We have the problem, that sometimes (it depends on the PC . sometimes often sometimes not so often) the Editor is empty.
    I have seen it that its only if other Microsoft Office Product are running (Excle, Word, Outlook) without these Programs running it doesn't happen (or doesn't hapen so fast)
    In our application, i can open a task (this is a WPTools Editor), on these PC, i open 5-6 task, the 6th task is empty. Than i have to close 3 tasks, and than i can open it correctly.
    Without Word or co, i can open many task simultan - without problem.
    On my Development machine i can open 15 task without problem (regardless if word is running or not - but these are Windows XP machine ...)
    The other PC are Windows 7, Windows 8, Windows 10, or Windows Terminal Server - all are the same.

    I checked allread the handles and co, seems correct, my application needs many of them, but there should be enough available.
    No error or somethin else.

    Maybe you have some additonal idees what i can check, or what the problem could be?

    Oh i think i found it :D

    but i think this line is wrong

    if c>0 then pdf.CommandStrEx( COMPDF_ApplyWatermark, '2-4', c);

    should be

    if c>0 then pdf.CommandStrEx( COMPDF_ApplyWatermark, '4', c);

    I just search but found nothing about stamping a pdf file with an other different pdf file
    Only stamping with plain Text or Metafile ...

    Can you show me an example?

    But i make NO programmatically Change of the Text
    I make NO mailmarge nothing

    It's only the simple RTF text which i would export to PDF
    and the whole Header isn't exported to PDF if i use the only one System variable Field!

    How do you mean this?

    If i print a rtf with a variable with the current date - it is pritned correct.
    If i print it to a pdf printer i can see the current date (from printing),
    If i export it to a pdf THE WHOLE Line is missing - the cahrs before the RTF Variable und the chars after the RTF Variable is missing too.

    Why isn't the RTF Variable be evaluated if i export it to pdf?

    Or is there an simple command for evaluate all variables to plain text which i have to execute before pdf export?

    Hello if i have a system Var in my header the header isn't exported to the pdf - what i am doing wrong?

    I tried it with this simply RTF, in the HEader a Systemvariable TIME and in the Body the same.
    The resulting PDF has only the Body.
    If i delete the SystemVar in the header, the header is exported to the PDF.

    If i print it to file it works.


    I updated some month ago
    I just noticed that the GetMetaFile dind't work anymore sometimes the distance between two words is incorrect

    i tried to modify the ViewDemo1 from you just extract the metafile and show it

    Image1.Picture.Graphic      := WPViewPDF1.GetMetafile(1);
        WPViewPDF1.Visible      := FALSE;

    This is the screenshot form the pdfviewer (PDFView1)
    [Blocked Image:]

    and if i start the above three lines of code i get following

    [Blocked Image:]

    you can see it in the last line, between "Bedienungsanleitung in" there is no Space in the metafile!

    what can i do?

    The last pdfview.dll extracted the metafile correct!

    I think the easisest way is to use the Component - because you can create it dynamic you don't need any visual components
    this is a code from my project don't know if it works perfect ;)

    hmmm i just tried some things ....

    This doesn't work :

    //WPRichText1.MergeText('', TRUE);    WPRichText1.ReformatAll(TRUE, TRUE);    WPRichText1.MergeText('', TRUE);    WPRichText1.ReformatAll(TRUE, TRUE);

    This works :

    WPRichText1.MergeText('', TRUE);
        //WPRichText1.ReformatAll(TRUE, TRUE);
        WPRichText1.MergeText('', TRUE);
        //WPRichText1.ReformatAll(TRUE, TRUE);

    What is the correct code?

    OK Thanks

    one another question

    if i directly Call the RichText.MergeText('', TRUE) after i added the AppendNewObjectPair(wpobjMergeField, fpItem.FieldName+'@ID'+IntToStr(sqlPos.FieldByName('ID').AsInteger));

    this field isn't filled.

    If i start the merge with a second button after the editfield is inserted, than it works

    Is there any function i have to call after inserting the fields?