The MindFusion Forums
Flow Diagramming Components >> WPF >> Diagram printing
https://mindfusion.eu/Forum/YaBB.pl?num=1526517624

Message started by Joel D. on May 17th, 2018 at 12:40am

Title: Diagram printing
Post by Joel D. on May 17th, 2018 at 12:40am
When using the Diagram.Print() function, the user can choose a new paper type using the printer's properties, but they can't preview before printing.  When using the Diagram.PrintPreview() function, the user doesn't have access to the printer properties to make any changes to the defaults, so the paper always displays as Portrait.

Is there a way to set the paper orientation to Landscape when using the PrintPreview() function?  Or even other paper sizes?

Thanks,
Joel.

Title: Re: Diagram printing
Post by Slavcho on May 17th, 2018 at 12:26pm
Check if this will work for you -
https://mindfusion.eu/Forum/YaBB.pl?num=1261177195/4#4

Regards,
Slavcho

Title: Re: Diagram printing
Post by Joel D. on May 17th, 2018 at 5:08pm
It works perfectly if the diagram is only one page.
If the diagram is two pages the document prints correctly, but if I scroll the Preview window to the second page, it crashes with the exception: "Invalid URI: The format of the URI could not be determined."  I guess this is completely on the .NET side of things.  Do you know if there's something that can be done about that?

Thanks!

Title: Re: Diagram printing
Post by Slavcho on May 21st, 2018 at 6:24pm
It works for me with multiple pages, but getting an exception if I try showing the viewer again with same pack id. Try changing it for each instance -
[code]
string pack = string.Format("pack://temp{0}.xps", xpsCounter++);[/code]

Regards,
Slavcho

Title: Re: Diagram printing
Post by Joel D. on May 21st, 2018 at 7:22pm
Looks like the problem was that I was calling PackageStore.RemovePackage(uri); right after window.Show().  I was calling that because printing twice caused an error due to using the same URI.  But now with your idea of incrementing a counter, it works fine.
Thanks!

The MindFusion Forums » Powered by YaBB 2.6.11!
YaBB Forum Software © 2000-2024. All Rights Reserved.