L'impression de fichiers Pdf avec PDFSharp

J'ai le code suivant:

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);
      }
    }
  }
}

Pour la vie de moi je ne peux pas obtenir que cela fonctionne et imprimer un fichier PDF unique. Chaque fois que je vais à imprimer, j'ai l'erreur "Impossible de trouver le fichier spécifié". Quelqu'un at-il une idée si quelque chose va mal avec mon code?? Je suis en utilisant PDFSharp ici...

  • où est le PDFSharp.PDF.L'impression d'espace de noms???
  • ahhh dans la version actuelle de PDFSharp l'ensemble de l'Impression de la classe est commenté
InformationsquelleAutor yeahumok | 2009-05-19