Beiträge von Zosox

    I can get the pages to print continuous numbers now using the property wpUsePrintPageNumber. I have a new issue now.

    These groups of letters print out to individuals and I need to restart the page numberr for each new person. Here is the code I used to try to restart the page numbering, but its not working.

    If lNewPerson then
    begin
    FWPRichText1.PrintParameter.PrintOptions := [];
    FWPRichText1.ReformatAll;
    End;

    What am I doing wrong?

    Thanks

    Hello

    I have a program that will print out letters to send to individuals. One letter may contain 5 pages, the second letter 2 pages and the third letter has just 1 page. The employee will be sent 3 letters with a total of 9 pages. We have to add page numbers to the letters, and they need to be able to have the first letter with 5 pages list out pages 1 thru 5, the second letter with pages 6 thru 8 and the last letter with just page 9.

    I added a footer to these letters and the text field for page number. However when I print out the letters, the numbers restart for each new letter. How do I make each new letter pick the next page number in line?

    Thanks!

    Hello

    I am trying to print almost 40000 letters out and at around 8000 letters, the process fails. I receive an access violation.

    " Project Letter.exe raised exception class EOutOfMemory with message
    'Zu wenig Arbeitsspeicher (4544)' "

    The unit WPPDFR1 is the unit raising the exception. The procedure DrawMetaFileex to be precise.

    Here is my code

    WPPDFExport2 := TWPPDFExport.Create(Application);
    WPPDFExport2.Source := DBWPRichText_1;

    WPPDFExport2.Filename := YesBackSlash(DBPath) +
    oDataSet.FieldByName('Mem_No').AsString +
    cLetterNumber + '.pdf';
    WPPDFExport2.BeginDoc;
    WPPDFExport2.Print;
    WPPDFExport2.EndDoc;


    MyPDF := TMemoryStream.Create;
    try
    BS := oDataSet.CreateBlobStream(oDataSet.FieldByName
    ('LetterImage'), bmWrite);
    try
    MyPDF.Clear;
    MyPDF.LoadFromFile(cPDFFilename);
    MyPDF.SaveToStream(BS);
    finally
    BS.free;
    end;
    finally
    MyPDF.Free;
    end;

    WPPDFExport2.Free;

    Any ideas as to what I could do to improve this code so I don't suck my memory dry?

    Thank!

    Zosox

    Hello

    I have a word doc thate has an image on the page. I have a process in my application that will import documents and display them on the screen for the user. When the user tries to import a doc with an image, the image is resizing it self.

    We were using Wptools 4 and this did not occur. This started happening when we upgraded to Wptools 5.

    Is there a property on the TWPRichtext component that will keep the image at its original size?

    Hello

    When printing out a letter using wprichtext, I have passed in a top margin of 0.25 inches, but when the letter prints it is not respecting the top margin. When I step through the code the topmargin is always correct, but when printed, the top margin is almost a 0.50 inch.

    Here is what my code looks like

    WPRichtext1.header.TopMargin := 360;
    WPRichtext1.header.BottomMargin := 1440;
    WPRichtext1.header.LeftMargin := 720;
    WPRichtext1.header.RightMargin := 720;

    WPRichText3.FastCopyProperties(WPRichText1);
    WPRichText3.FastAppendText(WPRichText1);
    WPRichText3.RTFData.UpdateReformatMode(False, True);
    WPRichText3.ReformatAll;
    WPRichText3.Print;

    Any ideas as to why the top margin is printing differently?

    Hello

    I have a place holder in a letter {B004}

    This is where I am going to input a table that I have created. The place holder {B004} has a tab specified. However when I place my table into the letter the table is ignoring my tab stop and placing the table at the left margin. If I just do inputstring('Test') instead of putting my table in the letter, the text of 'Test' respects the tab stop.

    How do I get a table to recognize my tab stop?

    Hello

    I am trying to copy a row from a table and place it directly underneath the row I copied from. Here is the layout of my letter

    Table 1 - contains titles etc..
    Table 2 - contains the data
    Table 3 - contains the totals

    I am trying to copy table 2 and place it before table 3 so it looks like this

    Table 1 - contains titles etc..
    Table 2 - contains the data
    Table 2 - contians the data for a second person
    Table 3 - contains the totals

    However it is doing one of two things.


    Here is the code for my first result. When I run this code it places the row I copied into the last cell of row I copied from.

    Table 1 - contains titles etc..
    Table 2 - contains the dataTable 2 - contians the data for a second person
    Table 3 - contains the totals


    //'035' is the value in the first cell of the row
    if WPRichText_3.Finder.Next('035') then
    begin

    // once '035' found, go to start of line and start selection
    WPRichText_3.Finder.MoveToFoundPositionStart;

    if paprIsTable in WPRichText_3.ActiveParagraph.prop then
    WPRichText_3.SelectThisRow
    else
    WPRichText_3.SelectLine;

    //'140' is the value in the last cell of the row I copied from
    If WPRichText_1.Finder.Next('140') then begin

    WPRichText_1.Finder.MoveToFoundPositionEnd;
    WPRichText_1.CPPosition :=
    WPRichText_1.Finder.FoundPosition;

    WPRichText_1.SelectionAsString :=
    WPRichText_3.SelectionAsString; // copy in this row
    WPRichText_1.ReformatAll;

    WPRichText_3.CPPosition := 0;
    End;
    end;

    Here is the code for my second result. When I run this code, it places the row I copied after the very last table in the letter.

    Table 1 - contains titles etc..
    Table 2 - contains the data
    Table 3 - contains the totals
    Table 2 - contians the data for a second person

    //'035' is the value in the first cell of the row
    if WPRichText_3.Finder.Next('035') then
    begin

    // once '035' found, go to start of line and start selection
    WPRichText_3.Finder.MoveToFoundPositionStart;

    if paprIsTable in WPRichText_3.ActiveParagraph.prop then
    WPRichText_3.SelectThisRow
    else
    WPRichText_3.SelectLine;

    //'140' is the value in the last cell of the row I copied from
    If WPRichText_1.Finder.Next('140') then begin

    WPRichText_1.Finder.MoveToFoundPositionEnd;
    WPRichText_1.CPPosition :=
    WPRichText_1.Finder.FoundPosition;

    WPRichText_1.ActiveParagraph :=
    WPRichText_1.FastAppendParagraph;
    WPRichText_1.SelectParagraph
    (WPRichText_1.ActiveParagraph);

    WPRichText_1.SelectionAsString :=
    WPRichText_3.SelectionAsString; // copy in this row
    WPRichText_1.ReformatAll;

    WPRichText_3.CPPosition := 0;
    End;
    end;

    Can you help me figure out what I am doing wrong?

    Hello

    I am receiving an access violation when the following line of code is executed.

    w := MulDiv(FSource.Memo._PaintPages[i].WidthTw,WPScreenPixelsPerInch,1440);

    This line is from the PrintPages procedure in the WPPDFWP unit.

    What I am doing is taking a TImage and inserting it into a TWPRichtext.

    Bitmap.LoadFromFile(FilePath);
    Image1.Picture.Assign(Bitmap);
    RichText.TextObjects.Insert(NewObject(Image1));

    I then assign my TWPRichtext to a TWPPDFExort

    PDFExport.Source := RichText;


    When I call print I get an access violation.

    PDFExport.Filename := (FilePath+cCo_Code+cTarget+'.pdf');
    PDFExport.BeginDoc;
    PDFExport.Print;
    PDFExport.EndDoc;

    Any ideas?

    I am using Delphi 7 with wptools 5. This did work using Wptools 4.

    Zo

    Hello

    We recently upgraded to WPTools 5 from WPtools 4 and we are using Delphi 7. When trying to print letters that are stored in a table it is taking a very long time to print the letters. It appears to be the amount of text/images etc in the letter that are affecting it. However it doesn't take long in Wptools 4 to print the letters.

    Below is one part of the code that is killing us.

    FDBWPRichText1.DataField := cLetter; //cLetter represents the field
    in which the letter is stored.

    When trying to assign the field it is taking upwards of 2 minutes to perform the assignment. The bigger the letter the more time it takes.

    The next line is also taking upwards of 2 minutes.
    FWPRichText1.Memo.RTFData.AssignFDBWPRichText1.Memo.RTFData);


    Is there anyway that we could speed up the process? Wptools 4 was much quicker when performing the above actions.

    Thank you!