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
Post a Comment