Hi,
I have created PDF file on one path and on print button click I want to display pdf file in Print preview dialog.
Thanks in advance.
I'm sorry but that is not supported. The MS PrintPreviewDialog and the Infragistics UltraPrintPreviewDialog both only deal with .NET PrintDocument instances. If you are using the Infragistics Documents assembly to generate the pdf then you may be able to generate thumbnails for the pages in the Report class as Matt describes here.
I was added all images in pdf file and trying to give it to UltraPrintPreviewDialog.
Instead of adding all images to pdf file I have added images to UltraPrintPreviewDialog and it works successfully J
private
void btnPrint_Click(object sender, EventArgs e)
{
PrintDocument printdoc = new PrintDocument();
Infragistics.Win.Printing.UltraPrintDocument ultraPrintDocument = new UltraPrintDocument();
UltraPrintPreviewDialog uPrvDlg = new UltraPrintPreviewDialog();
printdoc.PrintPage += new PrintPageEventHandler(ultraPrintDocument_PrintPage);
uPrvDlg.Document = printdoc;
uPrvDlg.ShowDialog();
}
void ultraPrintDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
Image image1 = null;
if (imageCount > 1)
img = GetImage();
image1 = img.ToBitmap(false);
MemoryImage = new Bitmap(image1);
e.Graphics.DrawImage(MemoryImage, 0, 0);
e.HasMorePages = false;
imageCount = 1;
else
img = GetImage();;
e.HasMorePages = true;
imageCount++;