I have a custom C# application that has a print option to print an image. It uses the WPF and printdialog to show the print dialog and print the image. This works fine from a local machine. If I deploy this application in citrix, it does not show the users local printers. Other standard applications show the local printers. Is there any additional code required to show the local printers?
It works fine without Citrix:
Here is the code:
private String imgFileName;
public void PrintTiff(Document doc)
{
PrintDocument pd = new PrintDocument();
System.Windows.Forms.PrintDialog printDialog1 = new System.Windows.Forms.PrintDialog();
foreach (DOKuStar.Data.Xml.ImageSource imgSrc in doc.Sources)
{
imgFileName = imgSrc.Url;
pd.DefaultPageSettings.Margins = new Margins(0, 0, 0, 0);
pd.OriginAtMargins = false;
pd.DefaultPageSettings.Landscape = false;
pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
}
printDialog1.Document = pd;
printDialog1.AllowSelection = true;
printDialog1.ShowNetwork = true;
printDialog1.UseEXDialog = true;
DialogResult result = printDialog1.ShowDialog();
if (result == DialogResult.OK)
{
pd.Print();
}
}
private void pd_PrintPage(object sender, PrintPageEventArgs e)
{
System.Drawing.Image img = System.Drawing.Image.FromFile(imgFileName);
e.Graphics.DrawImage(img, 1, 1);
}