Hi,
Hi there,
FileStream fs = new
FileStream(myDir + “HelloWorld.pdf”,
FileMode.Open, FileAccess.Read);<o:p></o:p>
byte[] tmpBytes = new byte[fs.Length];
fs.Read(tmpBytes, 0, Convert.ToInt32(fs.Length));
MemoryStream mystream = new MemoryStream(tmpBytes);
MyStream myStream = new MyStream(mystream);
PdfViewer viewer = new PdfViewer();
viewer.BindPdf(mystream);
viewer.PrintAsImage = true;
viewer.AutoResize = false;
// viewer.Resolution = 600;
viewer.AutoRotate = false;
//viewer.PrintPageDialog = true;
System.Windows.Forms.PrintDialog printDialog = new System.Windows.Forms.PrintDialog();
if (printDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
System.Drawing.Printing.PrinterSettings ps = printDialog.PrinterSettings;
System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings();
pgs.PaperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169);
pgs.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);
pgs.Landscape = true;
// ps.PrinterName = "Adobe PDF";
// ps.PrintToFile = true;
// ps.PrintFileName = myDir + "testoutprint.pdf";
viewer.PrintDocumentWithSettings(pgs, ps);
}
viewer.Close();
Please feel free to contact us for any further assistance.
Best Regards,
Hi,
Hi there,
More information about application pool usage - http://www.iis.net/learn/manage/configuring-security/application-pool-identities
Best Regards