不同的方向在多页的PrintDocument(如何) [英] Different orientation in a Multiple page PrintDocument (How to)

查看:182
本文介绍了不同的方向在多页的PrintDocument(如何)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个的PrintDocument 有好几页。 一个页面,该页面文件必须在风景的方向,而不是Portrail。

I have a PrintDocument that has several pages. One page in that document must be in a Landscape orientations instead of Portrail.

由于PrintPage事件是在该事件处理的非常开始时触发的每一页上的文档......我设置了 PrintPageEventArgs.PageSettings.Landscape 为true。

As the PrintPage event is triggered for each page on the document... at the very begining of that event handler I set the PrintPageEventArgs.PageSettings.Landscape to true.

这确实在该网页上没有作品...但我可以看到,景观设置为true和抽放考虑在接下来的页面。

That doesn't works on THAT page... but I can see that Landscape is set to true and taked into account in the NEXT page.

我认为不知何故......之后该事件被触发了某个页面,你无法更改页面方向。这是比较少的逻辑,如果你认为它......但我如何可以设置事件触发之前,该标志在一个多页的PrintDocument?

I assume that somehow... after the event is triggered for a certain page you are not able to change the page orientation. That is more of less logic if you think it... but HOW COULD I SET THAT FLAG before EVENT fires in a multiple page PrintDocument?

注:我不知道提前做,如果下一个页面将实际需要横向方向

Note: I don't know in advance if the "next" page will going to actually need a Landscape orientation.

推荐答案

我在.NET中没有专家在印刷;然而,使用反射;它看起来像你可能要处理的<一个href="http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.querypagesettings.aspx">QueryPageSettings活动上的PrintDocument。它看起来像PrintController的私人PrintLoop()方法,将在此为了使每个页面调用的事件:

I'm no expert at printing in .NET; however using Reflector; it looks like you might want to handle the QueryPageSettings event on PrintDocument. It looks like PrintController's private PrintLoop() method, will invoke events in this order for each page:

  1. QueryPageSettings
  2. 的起始页
  3. 的PrintPage
  4. 尾页

希望这有助于。

这篇关于不同的方向在多页的PrintDocument(如何)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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