简体   繁体   中英

WPF printing in Landscape

I have a DocumentPaginator that needs to be printed landscape.

My first thought was to this:

printDialog.PrintTicket.PageOrientation = System.Printing.PageOrientation.Landscape;

Problem is that this returns an error of

The type or namespace name 'PageOrientation' does not exist in the namespace 'System.Printing' (are you missing an assembly reference?)

Before you say it yes I have using System.Printing; and System.Printing is a references.

Why is this error occurring?

edit: Solution;

Turns out after doing a clean solution and then doing build the actually error was given. Turns out ReachFramework.dll was required as well.

Sometimes Visual Studio is not able to resolve names in XAML in the project or solution.may be after rebuilding your solution everything will works fine.

Then do a rebuild.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM