Hi,
We’ve created a Word document with a table and set the column headings to be repeated on each page of the output. When we create a physical file they display correctly. When we use the code below to Print Preview/Print it the column headings do not repeat. Can anybody help us.
Thanks
Adrian
Aspose.Words.Document doc = new Aspose.Words.Document("C:\\MyFile.doc");
PrintPreviewDialog previewDlg = new PrintPreviewDialog();
// Show non-modal first is a hack for the print preview form to show on top.
// previewDlg.Show();
// Initialize the Print Dialog with the number of pages in the document.
PrintDialog printDlg = new PrintDialog();
printDlg.AllowSomePages = true;
printDlg.PrinterSettings.MinimumPage = 1;
printDlg.PrinterSettings.MaximumPage = doc.PageCount;
printDlg.PrinterSettings.FromPage = 1;
printDlg.PrinterSettings.ToPage = doc.PageCount;
printDlg.PrinterSettings.DefaultPageSettings.Landscape = true;
try
{
if (!printDlg.ShowDialog().Equals(DialogResult.OK))
return;
// Create the Aspose.Words' implementation of the .NET print document
// and pass the printer settings from the dialog to the print document.
AsposeWordsPrintDocument awPrintDoc = new AsposeWordsPrintDocument(doc);
awPrintDoc.PrinterSettings = printDlg.PrinterSettings;
// Hide and invalidate preview is a hack for print preview to show on top.
previewDlg.Hide();
previewDlg.PrintPreviewControl.InvalidatePreview();
// Pass the Aspose.Words' print document to the .NET Print Preview dialog.
previewDlg.Document = awPrintDoc;
previewDlg.ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show("Your printer is not properly connected or you may not be connected to the network.\n\n Exception Message : " + ex.Message);
}