У меня есть следующий код:печать PDF-файлов с PDFsharp
using System;
using System.Diagnostics;
using System.IO;
using PdfSharp.Pdf.Printing;
namespace PrintPdfFile
{
class Program
{
[STAThread]
static void Main(string[] args)
{
// Set Acrobat Reader EXE, e.g.:
PdfFilePrinter.AdobeReaderPath = @"C:\\Documents and Settings\\mike.smith\\Desktop\\Adobe Reader 9.0.exe";
// -or-
//PdfPrinter.AdobeReaderPath = @"C:\Program Files\Adobe\[...]\AcroRd32.exe";
//// Ony my computer (running a German version of Windows XP) it is here:
//PdfFilePrinter.AdobeReaderPath = @"C:\\Documents and Settings\\mike.smith\\Desktop\\Adobe Reader 9.0.exe";
// Set the file to print and the Windows name of the printer.
// At my home office I have an old Laserjet 6L under my desk.
PdfFilePrinter printer = new PdfFilePrinter(@"C:\Documents and Settings\mike.smith\Desktop\Stuff\ReleaseNotesAndFolderList.pdf", " \\ny-dc-03\\IT-01");
try
{
printer.Print();
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
}
}
Для жизни меня я не могу получить эту работу и распечатать один PDF. В любое время, когда я иду на печать, я получаю сообщение об ошибке «Не могу найти указанный файл». Кто-нибудь знает, что-то не так с моим кодом? Я использую PDFsharp здесь ...
где находится пространство имен PDFSharp.PDF.Printing ??? – nuander
ahhh в текущей версии PDFSharp весь класс печати закомментирован – nuander