WPF C1FlexViewer with C1PdfDocumentSource Printing Codebehind

Posted by: sebastian-jn.k on 12 May 2023, 1:17 am EST

    • Post Options:
    • Link

    Posted 12 May 2023, 1:17 am EST

    hello,

    assembly versions 4.6.20222.770

    WPF C1FlexViewer with C1PdfDocumentSource Printing Codebehind

    Question:

    We use flexviewer for showing pdf files.

    Most toolbarbuttons are invisible.

    We need to initialize printing in two ways from codebehind.

    1. → start printing with print dialog.

      Solution for 1.: c1flexviewer.Pane.Print();

    2. → start printing with predefined System.Drawing.Printing.PrinterSettings without dialog

    minimal printer settings needed:

    printerSettings.PrinterName = “My Printer Name”;

    printerSettings.Copies = 2;

    printerSettings.FromPage = 1;

    printerSettings.ToPage = 1;

    printerSettings.PrintRange = System.Drawing.Printing.PrintRange.SomePages;

    How do we can achieve this?

    Example attachted.

    FlexViewerPdfQuestion.zip

    greetings from germany

  • Posted 15 May 2023, 11:24 pm EST

    Hi,

    Apologize for the delay,

    We are discussing this requirement with the development team. Will get back to you once we have any update from them.[Internal Tracking Id - C1WIN-29656]

    Best Regards,

    Nitin

  • Posted 1 June 2023, 7:13 pm EST

    Hello,

    do you have already a response from your team?

    greetings from germany

  • Posted 1 June 2023, 10:37 pm EST

    Hi,

    Apologize for the delay.

    We have asked for an update on this issue from the development team. Will inform you once they respond.

    regards,

    Nitin

  • Posted 7 June 2023, 1:06 am EST

    hello,

    Solution:

    var localPrintServer = new LocalPrintServer();
    var printQueue = localPrintServer.GetPrintQueue("Name of Printer");
    var printTicket = printQueue .DefaultPrintTicket;
    printTicket.CopyCount = x;
    
    var printOptions = new C1PrintOptions();
    printOptions .PrintQUeue = printQueue ;
    printOptions.PrintTicket = printTicket;
    printOptions.OutputRange = new OutputRange(x,y);
    
    c1PdfDocumentSource.Print(printOptions);

    greetings from germany

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels