如何在Silverlight中打印多页? [英] How to print multiple page in silverlight?

查看:77
本文介绍了如何在Silverlight中打印多页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在Silverlight中工作,并且我有一个带有很多行的网格.
在我的网格行"中,有许多用于显示目的的控件.
现在我要用所有行打印此Grid.
我在Silverlight中找到了许多用于PrintDocument的解决方案,但它只能多次打印第一页.

我的代码就像,

Hi,
I am working in silverlight and i have one Grid with many Rows.
In My Grid Row there are many control for display purpose.
Now i want to print this Grid with all row.
I found many solution for PrintDocument in Silverlight but it print only first page multiple time.

My code is like,

void btnPrint_Click(object sender, RoutedEventArgs e)
{
       PrintDocument pd = new PrintDocument();
       pd.PrintPage += new EventHandler<PrintPageEventArgs>(pd_PrintPage);
       pages.Add(grdMain);
       pd.Print("Title1");
}

void pd_PrintPage(object sender, PrintPageEventArgs e)
{
      e.PageVisual = grdMain;
      e.HasMorePages = true;
}



当我添加e.HasMorePages = true时,它将进入无限循环,并且不会打印.

请帮助我...



When i add e.HasMorePages = true that time it will going to infinite loop and does not print.

Please help me...

推荐答案

http://www.silverlightshow.net/items/A-look-at-the-Printing-API-in-Silverlight-4.aspx [
Exploring Silverlight 4 - Part I (The Printing API)[^]

http://www.silverlightshow.net/items/A-look-at-the-Printing-API-in-Silverlight-4.aspx[^]

Hope you can find useful



请参考以下链接:
打印多页和表格打印 [ Silverlight 4:打印功能 [ Silverlight 4-转换为图像并在多个页面中打印UIElement [ ^ ]

您可能还想阅读如何压缩多个将页面分成一页以在Silverlight中打印 [
Hi,
Refer the links below:
Printing Multiple Pages and Tabular Printing[^]
Silverlight 4: Printing Functionality[^]
Silverlight 4 - Converting to image and printing a UIElement in multiple pages[^]

You may also like to read How to Compress Several Pages into One Page to Print in Silverlight[^].


--Amit


这篇关于如何在Silverlight中打印多页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆