Beiträge von pjcunningham

    Hello All,

    The following RTF chunk causes the TParagraph.Trim method to enter an infinite loop.

    Code
    {\rtf1\ansi\deff0\uc1\ansicpg1250\deftab720{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset238 Arial;}{\f2\fnil\fcharset2 Wingdings;}{\f3\fnil\fcharset2 Symbol;}}{\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;\red128\green128\blue0;}\wpprheadfoot1\paperw12240\paperh15840\margl1880\margr1880\margt1440\margb1440\headery720\footery720\pgbrdrhead\pgbrdrfoot\pgbrdropt32\endnhere\sectdefaultcl{\*\generator WPTools_6.060;}{\stylesheet{\s1\li0\fi0\ri0\sb0\sa0\ql\vertalt\fs24 Normal;}{\s2\li0\fi0\ri0\sb0\sa0\ql\vertalt\fs22 Default Paragraph Font;}}{\tblstart1{\trowd\trleft0\trgaph108\trpaddfl3\trpaddl108\trpaddfr3\trpaddr108\trbrdrl\brdrs\brdrw10\trbrdrr\brdrs\brdrw10\trbrdrt\brdrs\brdrw10\trbrdrb\brdrs\brdrw10\trbrdrv\brdrs\brdrw10\trbrdrh\brdrs\brdrw10\trftsWidth3\trwWidth14148\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\clbrdrt\brdrs\brdrw45\clbrdrl\brdrs\brdrw10\clshdnil\clftsWidth3\clwWidth4580\clvertalt\cellx4580\pard\intbl\itap1\li0\fi0\ri0\sb0\sa0\ql\wpparflg32\clshdnil\plain\f1\fs16 - the SNSA's internal procedures OP 5.3, OP 5.5\cell\row}\tblend1\pard\plain\par}}


    The chunk came from a Word document that was pasted into a WPTools RTF RichEdit and then stored in database.

    WPTools 6.12.

    Regards, Paul

    Test Code


    Hello All,

    Is there an easy way of stripping out tables from RTF snippets ?

    I'm using TParagraph.LoadFromString to load RTF chunks, but some of the chunks have tables (pasted from Word) and I just want the text.

    Regards, Paul

    Hello All,

    Is it possible to use AddDataFile and then reference the embedded file in multiple locations throughout the RTF file, and ultimately in a PDF Export ?

    What I don't want to do is embed one file many times.

    Regards,
    Paul

    Hello Julian,

    I do not understand your reply. The AddDataFile is being used before the exporting has begun, the RTF file already has the embedded data.

    Did you see the line ?

    Code
    Editor.SaveToFile('c:\embed.rtf'); // This has the embedded manual

    The latest manual has the statement; "Using WPTools 6 and wPDF V3 it is now possible to add an object to the PDF file which holds embedded data.", and has some example code very similar to what I have posted.

    Cheers,
    Paul

    Hello Julian,

    Having trouble getting embedded data in a PDF. I can embed data in an RTF file using AddDataFile method, but when exporting using TWPPDFExport there is no embedded data.

    Regards,
    Paul Cunningham

    Test console code.

    Hello Julian,

    What is the best way of ensuring that the OnEditFieldFocus event is fired before a user clicks anywhere else in the application, for instance a menu or another control?

    In my application, leaving a field causes the field data to be written to a database if the edit field data and database field data differ.

    Or is there another way I can warn that a field has been edited but not tabbed out (and thus saved).

    Cheers,

    Paul

    Hello WpTools,

    Forgot to add that I have included the OnInitializeRTFDataObject event and tied the event to the two RichText editors.

    Code
    if RTFData = nil then begin
      	RTFData := TWPRTFDataCollection.Create(TWPRTFDataBlock);
       	RTFDataProps := TWPRTFProps.Create;
       	RTFData.RTFProps := RTFDataProps;
    	end;
    	RTFDataObject := RTFData;

    Paul

    Hello,

    Trying to create a split screen in code. As a test I've dropped two WPRichText editors on a form, set AllowMultiView to True and then dropped a TWPRTFStorage control and a TButton on the form.

    In the button onClick event I add the following code:

    This doesnt work. The second RichText editor stays blank. What am I missing? When I create the links using the Links property editor at design time it works!

    Regards,

    Paul

    Hello All,

    I'm trying to use the EmbedData method of wPDF3 in conjunction with WPTools and it's mail merge functionality.

    I'm generating a report dynamically and need to insert several embedded file icons into the pdf at the location of paragraphs that have been inserted during a OnMailMergeGetText event.

    Here is what I'm currently doing.

    1. Create the report and mail merge the paragraphs.
    2. Export the report to PDF using TWPPDFExport
    3. Now I need to go back and insert the icons that represent the embedded data.

    How do I find the page and values of the TRECT parameter of the EmbedData method so I can place the icon in the right place? Or can I achieve this some other way?

    Regards,

    Paul Cunningham