Printersetting property not accessible

Posted by: ashwini.kanchan on 22 November 2018, 5:22 am EST

    • Post Options:
    • Link

    Posted 22 November 2018, 5:22 am EST

    Hi, I wanted to print pdf silently. For that i am using componentone.

    But when i am trying to access methos pritersetting of C1PrintOptions to set the printer name I am not able to access it.

    My code is

    C1PdfDocumentSource pds = new C1PdfDocumentSource();

    pds.LoadFromFile(SourcefileName);

    try

    {

    C1PrintOptions po = new C1PrintOptions();

    po.printersetting // not able to see this method in context menu

    } pds.Print(po);

  • Posted 26 November 2018, 12:44 am EST

    Hello,

    Please instantiate po.PrinterSettings such that the modified code looks like:

    C1PdfDocumentSource pds = new C1PdfDocumentSource();
    pds.LoadFromFile(SourcefileName);
    C1PrintOptions po;
    try
    {
    po = new C1PrintOptions();
    po.PrinterSettings = new PrinterSettings();
    po.PrinterSettings.PrinterName = PrinterName;
    }
    pds.Print(po);
    

    Please refer the below mentioned documentation link for reference:

    http://help.grapecity.com/componentone/NetHelp/C1Document/webframe.html#Print-PDF.html

    This should help you print the pdf silently. Let us know if the issue persists.

    Best Regards,

    Esha

Need extra support?

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

Learn More

Forum Channels