Beiträge von ehimmer

    When using the Header/Footer manager, if there is no body text, just header text, the page shrinks to just the size of the header (ok I guess, but my users might get freaked out)

    Now if you then "paste" new text into the header, you get double vision (text overlaps and some of that overlapped text is duplicate). Just keying in text works fine.. it's the CTRL+V paste operation when the page has no body text that causes the problem. Pasting into the header when there is body text seems to work OK.

    If you exit and come back in, it appears correct, but paste some new text again, and back comes the double vision.

    To repro, bring up the header/footer manager and have just header text so that the page becomes shortened to the header height. Go to the home position and paste in some multilined text.. view the ugly results.

    At one point after a paste, I was backspacing and got an Access Violation, but have not been able to reproduce it to be able to send you more info on that error... so just a heads up (might be related tot he double vision).

    WPTools 5.18.5, Delphi 7

    FYI...

    It was the hyperlinks added via "InputHyperlink" (all 200+ of them) which slowed it down significantly. Even going through and deleting the wpoobjHyperlink text objects prior to the export to PDF did not improve the speed.

    Only when I replaced "InputHyperlink" with the psuedo-manual method using InsertNewObject of type wpobjHyperlink did the speed return to normal (2 or 3 seconds to export to PDF).

    That's my story, and I'm sticking to it!

    FYI ...

    I went through the exercise of removing all of the hyperlinks, and speed did not improve.

    I then went back to 5.17.4, and speed was still slow. So I guess I have more detective work to do in order to figure out what else I added that suddenly caused a slow PDF export.

    I recently made a change to the way I do checkboxes in my WPRichText. Previously it was simply a wingding character that I looked for when the user clicks on the WPRichText. When this was the case, the PDF Export took no more than one or two seconds to export a long WPRichText to a PDF document.

    The only thing I can think of is that I've changed these checkboxes to be hyperlinks, so I can trigger on hyperlink event to toggle the checkbox char instead. Now when I do a PDF export, it takes about 15 seconds to export the WPRichText to PDF.

    A print preview of the doc before the export is fine and very quick of course... but then taking that same doc and exporting it is now very slow.

    Is hyperlink conversion to PDF a rather intensive operation? I have something on the order of 160 hyperlinked checkboxes on a basic document... a lot more if users add additional ones.

    If this is the case, I guess I'll take the time to strip out the hyperlink text objects that are checkboxes prior to PDF export since obviously they don't really need to be hyperlinks once exported to PDF.

    If exporting hyperlinks is not the problem, then I have more detective work to do.

    Please advise...

    WPTools 5.18.5, wPDf 2.5.1, Delphi 7, WinXP Pro SP2

    P.S. Oh... there was one other change... I upgraded from WPTools 5.17.4 to 5.18.5. Not sure if that had anything to do with it or not.


    Eric

    I updated to 5.18.5, but while the PDF problem has been fixed, the behavior of the background color is now different. In pre-5.18.5, when I set the background char color of a word in the header, the color height was the character height... desired. But now, the color height is the line height... not desired.

    For example, my header has an image in it, causing the text on the same line to be pushed down to line up with the bottom of the image (see my other post about an image alignment problem with header images). Prior to the 5.18.5 update, the background color would be only as high as the characters. But now, the color stretches up to the top of the header area by the amount the image had pushed the text down. Understand??

    Eric

    I've updated to 5.18.5 from 5.18.3, and now images in my headers are not aligned properly. They are configured to align as character, and they used to show up with the bottom edge aligned with the bottom edge of the text as expected. But with 5.18.5, the bottom edge is pushed way down.

    Note that this only occurs in the header... still aligns fine in the body (didn't test the footer).

    Thanks Julian... setting Ok := false did the trick in the editor portion of my app... I can keep my paths using a placeholder to be resolved at image load time.

    However, in my mail merge/report generation time, this did not work... but I found if I resolved the path and set the Source equal to the resolved path, then the mailmerge/report creation phase now works as well.

    note: for a reason unknown to me, trying to set the text object's steamname in the OnRequestHTTPImage caused an invalid pointer operation in your CloseDestination routine when it assigns StreamName to the Source, so I had to resolve the path and assign it to Source earlier.

    FYI... that error occured in here:

    Code
    if obj.StreamName <> '' then //V5.17.3
                begin
                  RTFDataCollection.RequestHTTPImage(Self, FLoadPath, obj.StreamName, txtobj);
                // see: procedure TWPRTFReader.LoadLinkedImage
                  txtobj.Source := obj.StreamName;
                end;

    Something has gone very wrong with fonts. I had a simple document with some embedded wingding characters using WPTools 5.17.4. I updated to 5.18.3, and it looks fine until I edit it in any way, like deleting a character and re-entering it or even performing a mailmerge with it. Then when I save and reload it, the document is primarily wingdings. Here is the RTF before and after...

    before (from 5.17.4 or earlier):

    Zitat

    {\rtf1\ansi\deff0\uc1\ansicpg1252\deftab720{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset2 WingDings;}{\f2\fnil\fcharset0 Arial;}{\f3\fnil\fcharset1 WingDings;}}{\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;}\wpprheadfoot1\paperw12240\paperh15840\margl735\margr720\margt1440\margb1440\headery720\footery720\endnhere\sectdefaultcl{\*\generator WPTools_5.18;}{\info{\*\title WPTools_5.09;}
    }{\li180\tx1080\tx630\tx1545\tx2520\plain\f1\fs28\b\'A8 \f1\tab\'A8 \f1\tab\'A8 \f1\tab\'A8\fs24 \tab <$nextlevel:A>. <$caption>\par
    \pard\tx2865\plain\fs22\tab\fs20\i Comments:\par
    \pard\li2880\plain\fs22 <$document>\par
    \pard\plain\li2880\par
    }}

    After (after an edit with 5.18.3):

    Zitat

    {\rtf1\ansi\deff0\uc1\ansicpg1252\deftab720{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset2 WingDings;}{\f2\fnil\fcharset1 WingDings;}}{\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;}\wpprheadfoot1\paperw12240\paperh15840\margl735\margr720\margt1440\margb1440\headery720\footery720\endnhere\sectdefaultcl{\*\generator WPTools_5.18;}{\info{\*\title WPTools_5.09;}
    }{\li180\tx1080\tx630\tx1545\tx2520\plain\f1\fs28\b\'A8 \tab\'A8 \tab\'A8 \tab\'A8\f1\fs24 \tab <$nextlevel:A>. <$caption>\par
    \pard\tx2865\plain\fs22\tab\fs20\i Comments:\par
    \pard\li2880\plain\fs22 <$document>\par
    \pard\plain\li2880\par
    }}

    I can send you images of what it looks like before and after in case you need it.

    Delphi 7, WPTools 5.18.3, WinXP Pro Sp2

    Eric

    If I set some text in the header to have a background character color of say Yellow, it looks fine in print preview, but when I export it to PDF, the color is missing. Is it that I am doing something wrong with the PDFExport settings, a bug in PDF export, old Acrobat reader, or is this just the way it is for PDF export?

    Using WPTools 5.17.4, WPDF 2.51, Delphi 7

    While your suggestion works in some cases, it does not work for mailmerge linked images from what I can see (ObjRef.FileName is an empty string).

    However, I found that if I comment out the following lines starting at line 1221 in WPIOReadRTF.PAS that appears to have been added in 5.17.3, then I can leave all alone and my code works as it has been (just using AsString), and it works even with mailmerge.

    Code
    if obj.StreamName <> '' then //V5.17.3
              begin
                RTFDataCollection.RequestHTTPImage(Self, FLoadPath, obj.StreamName, txtobj);
                // see: procedure TWPRTFReader.LoadLinkedImage
                txtobj.Source := obj.StreamName;
              end;

    What is the purpose of this code? It really hoses up my linked images during mailmerge and AsString to AsString copies from one WPRichText to another.

    I had been using 5.17.2a, and copying a WPRichText from one to another using something like:

    Code
    WPRichText1.AsString := WPRichText_FLayout.AsString;


    This worked fine when a linked image was contained and later loaded the image using LoadObjFromFile when looping through the text objects.

    However, this does not work with 5.17.4. To copy one WPRichText to another I have to do this:

    Code
    WPRichText1.Assign( WPRichText_FLayout );

    Was this intentional or maybe the proper way all along?
    Eric

    Thanks, but it still is not perfect... a new problem has popped up.

    Again, using your SectAppend demo:

    - remove the footer from WP1.

    - Add a first page footer and an all pages footer to WP2.

    - Click on the AppendAll: Alternative to invoke the AppendAsSection.

    Notice how the first page footer from WP2 shows up on the first page of WP1's pages.

    Hurry back from vacation! ;o)

    Eric

    Excellent.. thanks. However...

    While your fix works, I noticed something that I thought was OK before. If you uncomment out those two lines so that it is back to the original demo for Append2.OnClick but with the additional header/footer first page, header/footer all pages for WP2, the second section only displays the Header/Footer for all pages for section 2.

    I was under the impression that each new section could have their own header/footer for all pages and header/footer for first page, etc, that is in relation its section. i.e. that section's header/footer for page 1 applies to the first page of the section. Plus I thought this was working before the fix in 5.17.2... I could be wrong though.

    Julian,

    I just installed 5.17.1, and it does not appear that you addressed this problem. Am I correct (all I did was recompile the sample as I had modified as described earlier)?

    Please... it is extremely important to my application! I'd like to retire while I am still young... um, well not too too old anyway... and I need this fix so I can move forward to this end :) Not to mention that my clients will stop beating me up... always a good thing.

    Thanks,
    Eric

    Is there a way to align the text in a table cell to top/bottom?

    Problem we have is that on a single table row, we might have one cell with a character having a font size larger than text in another cell. When this occurs, the cell with the smaller font appears higher than the cell that has the character with the larger font.

    If I could align the text to the bottom, or if a table row's height and text alignment were based on the text in the *whole* row, not just per cell, then it would look fine.

    Thanks,
    Eric

    Addict spell has a method called StartSequenceCheck to allow multiple controls to be checked before closing dictionaries and displaying the "Spellcheck Completed" dialog among other things.

    However, it doesn't seem to work with multiple CheckWPTools procedures recommended to be used to spellcheck a WPRichText control (I still get the "spell check completed" dialog between each control check).

    Do I basically have to set the appropriate options myself and not use StartSequenceCheck, or is there something I might be missing?

    AddictSpell 3.4.2, WPTools 5.16, Delphi 7

    Thanks,
    Eric

    I have a problem using AppendAsSection:

    To reproduce, use your SectAppend sample task.

    1. Add both a header first page and a footer first page to the existing header/footer all pages for WP2 (second of the three richtexts)
    2. In the Append2.OnClick event, comment out the first and last AppendAsSection lines, so you are left with just the one:
    WPAll.HeaderFooter.AppendAsSection(WP2.HeaderFooter);
    3. Run the sample
    4. Click on the "Append All: Alternative" button (invokes the Append2 click event)
    5. View the results... you should see the probelm in that that the first header shown is the "all pages" heading, and the second page heading is the "first page" heading. Likewise for the footer.


    WPTools 5.16, Delphi 7

    Thanks,
    Eric