Bonjour,
j'utilise le code suivant trouvé sur ce forum pour imprimer:
private void PrintDocumentToPrinter(string path, string printer)
{
try {
Process p = new Process() ;
ProcessStartInfo info = new ProcessStartInfo() ; info.FileName = path ;
info.Verb = "printto" ;
info.CreateNoWindow = true ;
info.Arguments = printer ;
info.WindowStyle = ProcessWindowStyle.Hidden ;
info.UseShellExecute = true ;
p.StartInfo = info ;
p.Start() ;
}
catch
{throw new ApplicationException("Can't print...");}
}
j'utilise ce code dans une application web.
ce code fonctionne sur mon poste de développement.
Mais quand je l'installe sur un serveur windows 2003, quand j'essaie d'imprimer rien ne se passe sans aucun message d'erreur.
Y a-t-il des prerequis pour que ça fonctionne ?
Si quelqu'un voit d'où ça peut venir, merci d'avance.
Partager