This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, December 23, 2008 6:10:30 PM(UTC)
Groups: Registered
Posts: 74
hello,
My application is a windows based application using c#.net 2008(winforms) and framework is 3.5 and also use Leadtools version(16). In my application,
i want to display images in printpreview.it is workig and but the not display in print preview.the code i wrote for,
try
{
_printPage = 1;
if (_printDocument != null)
{
PrintPreviewDialog dlg = new PrintPreviewDialog();
dlg.Icon = Icon;
foreach (Control i in dlg.Controls)
{
PrintPreviewControl c = i as PrintPreviewControl;
if (c != null)
{
c.StartPage = rstrToolsimageViewer.Image.Page-1 ;
break;
}
}
dlg.Document = _printDocument;
dlg.ShowDialog(
this);
}
}
catch { }
regards,
Dillep
#2
Posted
:
Wednesday, December 24, 2008 1:40:22 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Dillep,
Do you mean that the image doesn't appear in the Preview dialog?
To resolve the problem, please try the following code:
+-----------------+
PrintDocument _printDocument;
private void InitClass( )
{
...
_printDocument = new PrintDocument();
_printDocument.PrintPage += new PrintPageEventHandler(_printDocument_PrintPage);
...
}
private void _printDocument_PrintPage(object sender, PrintPageEventArgs e)
{
RasterImage image = rasterImageViewer1.Image;
RasterImagePrinter printer = new RasterImagePrinter();
printer.UseDpi = rasterImageViewer1.UseDpi;
printer.Print(image, image.Page, e);
}
private void _menuItemFilePrintPreview_Click(object sender, EventArgs e)
{
if(_printDocument != null)
{
try
{
PrintPreviewDialog dlg = new PrintPreviewDialog();
dlg.Document = _printDocument;
dlg.ShowDialog(this);
}
catch { }
}
}
+-----------------+
Please try the same issue using the above code and let me know how it goes.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.