title: PDFsharp asking for a PDF to be opened for Import when adding pages
body: <p>I have 3 PDFs, I want to add the pages from them to an output PDF file. What I’m trying to do is: import first PDF -> create new PDF document -> add pages -> draw in certain page and finally I want to add the pages from that document to the main PDF document that will be exported. Proceed to do the same with the second PDF file if needed.</p>
  
  <pre><code>ERROR: A PDF document must be opened with PdfDocumentOpenMode.Import to import pages from it.
  </code></pre>
  
  <p>From the main class I call the method that processes the PDF:</p>
  
  <pre><code>        Pdftest pdftest = new Pdftest();
          PdfDocument pdf = PdfReader.Open(@"C:\Users\pdf_file.pdf", PdfDocumentOpenMode.Import);
          pdftest.CreatePages(pdf_file);
  </code></pre>
  
  <p>Pdftest class:</p>
  
  <pre><code>public class Pdftest
  {
      PdfDocument PDFNewDoc = new PdfDocument();
      XFont fontChico = new XFont("Verdana", 8, XFontStyle.Bold);
      XFont fontGrande = new XFont("Verdana", 12, XFontStyle.Bold);
      XBrush fontBrush = XBrushes.Black;
  
      public void CreatePages(PdfDocument archivoPdf)
      {
          PdfDocument NuevoDoc = new PdfDocument();
  
          for (int Pg = 0; Pg &lt; archivoPdf.Pages.Count; Pg++)
          {
              PdfPage pp = NuevoDoc.AddPage(archivoPdf.Pages[Pg]);
          }
  
          XGraphics Graficador = XGraphics.FromPdfPage(NuevoDoc.Pages[0]);
  
          XPoint coordinate = new XPoint();
          coordinate.X = XUnit.FromInch(1.4);
          coordinate.Y = XUnit.FromInch(1.8);
  
          graficador.DrawString("TEST", fontChico, fontBrush, coordinates);
  
          for (int Pg = 0; Pg &lt; NuevoDoc.Pages.Count; Pg++)
          {
              PdfPage pp = PDFNewDoc.AddPage(NuevoDoc.Pages[Pg]); //Error mentioned.
          }
      }
   }
  </code></pre>