コード例 #1
0
        public static void Run()
        {
            // ExStart:1
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdf_Tables();

            // Load existing PDF document
            Document pdfDocument = new Document(dataDir + "Table_input2.pdf");

            // Create TableAbsorber object to find tables
            TableAbsorber absorber = new TableAbsorber();

            // Visit second page with absorber
            absorber.Visit(pdfDocument.Pages[1]);

            // Get copy of table collection
            AbsorbedTable[] tables = new AbsorbedTable[absorber.TableList.Count];
            absorber.TableList.CopyTo(tables, 0);

            // Loop through the copy of collection and removing tables
            foreach (AbsorbedTable table in tables)
            {
                absorber.Remove(table);
            }

            // Save document
            pdfDocument.Save(dataDir + "Table2_out.pdf");
            // ExEnd:1
        }
コード例 #2
0
        public static void Run()
        {
            // ExStart:1
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdf_Tables();

            // Load existing PDF document
            Document pdfDocument = new Document(dataDir + "Table_input.pdf");

            // Create TableAbsorber object to find tables
            TableAbsorber absorber = new TableAbsorber();

            // Visit first page with absorber
            absorber.Visit(pdfDocument.Pages[1]);

            // Get first table on the page
            AbsorbedTable table = absorber.TableList[0];

            // Remove the table
            absorber.Remove(table);

            // Save PDF
            pdfDocument.Save(dataDir + "Table_out.pdf");
            // ExEnd:1
        }