I have a letters in Styled Text that I am printing (one for each record) with data being merged in from the database.
All letters print to the printer perfectly, but sometimes you want to open the letters in Print Preview first.
I call an initial OpenPrintDialog, save the print settings, and continue printing using the code below:
Dim stp as StyledTextPrinter
Dim g as Graphics
Dim ps as New PrinterSetup
Dim pageWidth, pageHeight as Integer
pageWidth=72*7.5 //default width and height
If PageSetup <> "" then //PageSetup contains properties
// open Print dialog with Page Setup properties
g=openPrinterDialog(ps) //open Printer Dialog and set PageSetup
PageSetup = ps.SetupString
If g <> Nil then //user didnt cancel Print dialog
Do Until stp.EOF
if not stp.eof then //is there text remaining to print?
The problem is that when I select “Open PDF in Preview” only the first page opens in Preview - the rest go straight to the printer. Is there a way to have all the letters in the print job open in Preview?
When you print to the printer, it doesn’t matter if all the documents print as individual docs, but when printing to a PDF, it would be better to combine all the documents into a single PDF document. Is there a preference for this option?
I tried to add all the letters to a single TextArea but I think I hit the maximum number of characters for the field.