DIR Return Create A Forum - Home
---------------------------------------------------------
social facebook
HTML https://socialfacebook.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Social Facebook
*****************************************************
#Post#: 79--------------------------------------------------
How to: Invoke a Print Dialog
By: eyeconic Date: April 5, 2018, 9:44 am
---------------------------------------------------------
To provide the ability to print from you application, you can
simply create and open a PrintDialog object. +
Example
The PrintDialog control provides a single entry point for UI,
configuration, and XPS job submission. The control is easy to
use and can be instantiated by using Extensible Application
Markup Language (XAML) markup or code. The following example
demonstrates how to instantiate and open the control in code and
how to print from it. It also shows how to ensure that the
dialog will give the user the option of setting a specific range
of pages. The example code assumes that there is a file
FixedDocumentSequence.xps in the root of the C: drive.
C# Copy
private void InvokePrint(object sender, RoutedEventArgs e)
{
// Create the print dialog object and set options
PrintDialog pDialog = new PrintDialog();
pDialog.PageRangeSelection =
PageRangeSelection.AllPages;
pDialog.UserPageRangeEnabled = true;
// Display the dialog. This returns true if the user
presses the Print button.
Nullable<Boolean> print = pDialog.ShowDialog();
if (print == true)
{
XpsDocument xpsDocument = new
XpsDocument("C:\\FixedDocumentSequence.xps",
FileAccess.ReadWrite);
FixedDocumentSequence fixedDocSeq =
xpsDocument.GetFixedDocumentSequence();
pDialog.PrintDocument(fixedDocSeq.DocumentPaginator,
"Test print job");
<script>
(function() {
var cx = '017846004531943245215:ntog6z4xfuc';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = '
HTML https://cse.google.com/cse.js?cx='
+ cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>
*****************************************************