Adding Custom Options
PrintTaskOptionDetails supports exposing custom options that make sense only to your app. For example, the Calendar app could support printing modes of Day, Work week, Week, or Month, independently of the current display on the screen.
The following code adds two custom options. One can be set to freeform text, whereas the other must be set to a value from a predefined list:
void OnPrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs args) { // This is invoked when the Print pane opens PrintTask task = args.Request.CreatePrintTask("Document Title", async (taskArgs) => { ... }); PrintTaskOptionDetails details = PrintTaskOptionDetails.GetFromPrintTaskOptions(task.Options); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access