Beiträge von itsdev

    Here's my problem: I need to convert the wptools rtf files to postscript. My approach has been to use a postscript printer driver and set it to print to a file. This works fine, the problem is that each time I print, the 'Print to File' dialog comes up requiring me to specify the output file.

    Is there a way to bypass this dialog and specify the output file in code, or is there a better way to convert the wptools rtf files to ps?

    Thanks.

    I'm using WPTools 4.2 with C++ Builder 6 to load multiple rtf documents (also created using WPTools 4.2) 1 at a time, merge data fields, and then route them to different printers depending on certain data parameters.

    My problem is that about 90% of the documents print fine but about 10% don't. The files have all been created with the 'Courier New' font, but since this doesn't print dark enough, I'm changing to HP's 'Dark Courier' font after loading the document. Every now and then, one of the reports will print in Arial which really messes up the alignment.

    I've tried many different things, here is the code that I execute for each individual file as it sits now, what am I doing wrong?

    WPRichText1->LoadFromFile(RTFFname);
    WPRichText1->HideInsertpoints = false;
    WPRichText1->MergeText();
    WPRichText1->HideInsertpoints = true;

    Printer()->PrinterIndex = Printer()->Printers->IndexOf(PrinterName);
    WPPrinterOpen();
    WPRichText1->Memo->ReformatAll();

    WPRichText1->WorkOnText = wpFooter;
    WPRichText1->SelectAll();
    WPRichText1->Font->Name = "Dark Courier";
    WPRichText1->WorkOnText = wpHeader;
    WPRichText1->SelectAll();
    WPRichText1->Font->Name = "Dark Courier";
    WPRichText1->WorkOnText = wpBody;
    WPRichText1->SelectAll();
    WPRichText1->Font->Name = "Dark Courier";
    WPRichText1->Memo->ReformatAll();
    WPRichText1->Refresh();

    WPRichText1->Print();

    Thanks for your help!

    Gordon