How to Set Document Orientation (for All Pages) in MigraDoc Library?

倖福魔咒の 提交于 2019-12-01 05:21:44
Vive la déraison

Assign DefaultPageSetup.Clone() to the PageFormat of your section and modify that.

Then you modify a copy of the default settings and no assertion will fail.

With your approach, all documents would default to landscape - not just the document you set it for.

This answer applies to MigraDoc only as only MigraDoc uses DefaultPageSetup.

See this post in the PDFsharp forum where Clone() is used to create a copy of the DefaultPageSetup:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!