c# - How to save a stackpanel as an XPS document in multiple pages in WPF? -


i need save large stackpanel xps document. since stackpanel lengthy, cannot accommodated in single page while printing. there way save stackpanel in xps expanding multiple pages?

below code saves single page:

transform transform = stkpnlmain.layouttransform; stkpnlmain.layouttransform = null; size size = new size(stkpnlmain.actualwidth, stkpnlmain.actualheight); stkpnlmain.measure(size); stkpnlmain.arrange(new rect(size));  package package = package.open(destination.localpath, filemode.create); xpsdocument doc = new xpsdocument(package); xpsdocumentwriter writer = xpsdocument.createxpsdocumentwriter(doc); writer.write(stkpnlmain);  doc.close(); package.close(); 

here, stkpnlmain lengthy block.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -