Beiträge von Jeremy

    Print and setup printer may usually be enabled, but they are not for me. I have a row of square buttons on the upper left that show outlines when I mouse over them, but no icons or captions.

    I've stepped through WPPrvFrm in the debugger. btnPrint.Visible is True when dia.ShowModal is called. I think my problem isn't so much visibility as setting up the buttons. No icon, no caption on the button in the preview form.

    One odd thing I see in the debugger is that the following code is apparently not active (no blue dots). Please note that I HAVE enabled the define in the .inc file {$DEFINE WP6}.

    Code
    {$IFDEF WP6} 
        if SecOptionIsSet(FEditBox.SecurityOptions, wpSecNoSaveDialog) then
        begin
          dia.btnSavePDF.Visible := false;
          dia.btnSaveExport.Visible := false;
        end else
    {$ENDIF}

    we have a bunch of wp4 templates & are converting to wp6. The ones with tables have slightly larger line height when printed with wp6. I've tried all the formatoptions I can imagine might make a difference, but still it isn't quite right. Anything else I can try?

    Code
    rtfMerged.FormatOptions := rtfMerged.FormatOptions + [wpUseAbsoluteFontHeight, wpNoMinimumCellPadding, wpfIgnoreMinimumRowheight, wpfIgnoreMaximumRowheight];
    
    
    rtfMerged.FormatOptionsEx := [wpDontIgnoreSpacebeforeOnTopOfPage, wpDontAddExternalFontLeading,  wpDontUseTablePadding,
    wpDontUseRowPadding, wpDontUseBorderPadding, wpDontInheritCellAttr,  wpfIgnoreTrailingEmptyParAtFooter];

    I asked this question about a month ago, but it must have been overlooked.

    I'm using a twpPreviewdlg, and want to allow the user to setup a printer and print. I must be misunderstanding how to do this. The following doesn't do it. I do get a several unlabeled buttons top left.

    I'm using the twppreviewdlg so I don't have to create a form.

    I'm upgrading from wp4 to wp6, and am creating a merge field in code. The ReplacementVar is a string, and in ongettext, I provide a value.

    The problem is, when I'm editing the mergetemplate, I don't see the name, just the <<>> delimiters. Existing templates do display the name, but when I add a new field to the existing template, it doesn't show.

    Code
    var inputMergeFld: TWPTextObj;inputMergeFld := rtfTemplate.InputMergeField(ReplacementVar);

    Later ..

    Ok, I found this and it works. Does seem pretty wierd, considering that the manual implies this is the default behavior:

    Code
    with rtfTemplate.InsertPointAttr do CodeOpeningText := CodeOpeningText+'%N';

    As I continue to compare my app using wp4 vs wp6, I find another difference. One line of a merged doc sometimes is empty, and sometimes has some chars. If empty, the line height is slightly less. I have the following code.

    Code
    rtfMerged.FormatOptions       := rtfMerged.FormatOptions + [wpUseAbsoluteFontHeight];
    rtfMerged.FormatOptionsEx    := [wpDontIgnoreSpacebeforeOnTopOfPage,wpDontAddExternalFontLeading];

    I solved the problem by using a space instead of an empty string, but isn't there a nicer way?

    I think I have the answer. There is an enumerated type wpCreateNewPage, not documented, but used in an example on p40 of WPToolsManual.pdf. There is one post auf Deutsch last november, but otherwise this little baby is hidden.

    Replace the following ..

    Code
    rtfMerged.CPPosition := MaxInt;           rtfMerged.InputString(#12);     //new page. jhg 02/24/2011           rtfmerged.FastAppendText(rtftemplate);

    With ..

    Code
    rtfmerged.FastAppendText(rtftemplate,True,[wpCreateNewPage]);

    Please ignore my previous post. This one has better information.

    I turned on visibility of CR, NL, FF etc. in the previewer.

    My merge document template is 2 pages, and in my test case, I have 4 items, which in WP4 produced a total of 8 pages. The merge document template begins and ends with a CR. In WP6, an extra CR is being added at the top of items 2, 3, and 4. I don't see why. Does inputString(#12) add a paragraph as well as a formfeed? Here is the code:

    I'm using a twpPreviewdlg, and want to allow the user to setup a printer and print. I must be misunderstanding how to do this. The following doesn't do it. I do get an unlabeled button top left that closes the dialog.

    I'm using the twppreviewdlg so I don't have to create a form.

    I merge one page at a time, appending them to a twpcustomrtfedit. The 1st page has one fewer blank lines at the top than all the others. I can fix this by adding a blank line at the top of the first page (below) but that makes me cringe. There's gotta be something I'm missing. Any ideas?

    I'm previewing a one page document. I setup a twprichtext instance (below), and assign it to the editbox property. In wp4, it displayed as landscape, as intended, but in wp6 it doesn't.


    Viewing the same rtf file in a wp4 editor and toggling to the same view in a wp6 editor, I can see that the line height is very slightly bigger in wp6.

    I'm beginning to get the idea that we'll have to edit every existing merge template to make sure we don't get unwanted page feeds. Tell me it isn't so!

    Jeremy

    I have a bunch of merge templates built in WP4, and I am finally trying to upgrade my app to WP6. The templates want 59 lines, but wptools 6 is giving them only 58. They were mostly designed for legal size in portrait mode.

    It would be a big deal to go through the hundred-plus templates and revise them. Is there a setting?

    I posted the following some time ago in the wp5 forum, and there hasn't been any response. I'm actually using wp6, hence the repost here.

    - jeremy

    I have hideinsertpoints set to True, and it does work correctly when the field has a string of length 1 or more. But if the string is empty, the insertpoints show.

    I found a post with this issue back in 2007, and it looks like your advice was to put something into the field, or delete it.

    Is there a simpler way now? Shouldn't we at least have a flag to hide insertpoints on empty fields?

    Jeremy
    _________________