Exemplo n.º 1
0
        static private void ShowFirstPageContent(string filename)
        {
            PdfDocument document = new PdfDocument();

            document.Load(filename, false);

            PdfContents contents = document.Catalog.Pages[0].Contents;

            // Get a parser for decoding the contents of the page
            PdfContentsParser parser = contents.CreateParser();

            // Keep getting new content commands until no more left
            PdfObject obj = null;

            while ((obj = parser.GetObject()) != null)
            {
                Console.WriteLine(obj);
            }

            document.Close();
        }