I have create pdfdocument :
Code:
PdfDocument document = new PdfDocument();
document.Info.Author = "Ordinazioni";
PdfPage page = document.AddPage();
page.Orientation = PageOrientation.Landscape;
page.Width = 300;
pg.Height = XUnit.FromMillimeter(1000);
..... my code ........
document.Save("c:\\documenti\\file.pdf");
for print the docuemnt :
Code:
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
try
{
// Get the path that stores user documents.
// string myDocumentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
myProcess.StartInfo.FileName = "c:\\documenti\\file.pdf";
myProcess.StartInfo.Verb = "Print";
myProcess.StartInfo.Arguments = "\"" + cStampante + "\"";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
}
catch (System.ComponentModel.Win32Exception e)
{
if (e.NativeErrorCode == ERROR_FILE_NOT_FOUND)
{
Console.WriteLine(e.Message + ". Check the path.");
}
else if (e.NativeErrorCode == ERROR_ACCESS_DENIED)
{
// Note that if your word processor might generate exceptions
// such as this, which are handled first.
Console.WriteLine(e.Message +
". You do not have permission to print this file.");
}
}
My Problem is: how to imposes the propety page to Anybody?
Scusate il mio inglese .......