Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

PdfViewer.PrintDocumentWithSettings

$
0
0
Hello,

Imagine that i have this method:

private void PrintDocument(string filePath)
        {
            PdfViewer viewer = new PdfViewer();
            viewer.OpenPdfFile(filePath);
            viewer.AutoResize = true;         
            viewer.AutoRotate = true;         
            viewer.PrintPageDialog = false;
            System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings();
            PrintDocument prtdoc = new PrintDocument();
            ps.PrinterName = prtdoc.PrinterSettings.PrinterName;
            PageSettings pgs = new PageSettings();
            pgs.PaperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169);
            pgs.Margins = new Margins(0, 0, 0, 0);
            viewer.PrintDocumentWithSettings(pgs, ps);
            viewer.Close();
        }

I am working on a project that has multiple threads each one with a queue. 
Now imagine that i have 2 threads calling the method above and send the request to the same printer or different printers. Will it works? I mean, does pdfViewer manage the requests automatically or i have to control them by myself?

Thanks.

Viewing all articles
Browse latest Browse all 3131

Trending Articles