public static void Run()
 {
     // ExStart:SetBorder
     // The path to the documents directory.
     string dataDir = RunExamples.GetDataDir_AsposePdf_Tables();
    
     // Instantiate Document object
     Document doc = new Document();
     // Add page to PDF document
     Page page = doc.Pages.Add();
     // Create BorderInfo object
     Aspose.Pdf.BorderInfo border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All);
     // Specify that Top border will be double
     border.Top.IsDoubled = true;
     // Specify that bottom border will be double
     border.Bottom.IsDoubled = true;
     // Instantiate Table object
     Aspose.Pdf.Table table = new Aspose.Pdf.Table();
     // Specify Columns width information
     table.ColumnWidths = "100";
     // Create Row object
     Aspose.Pdf.Row row = table.Rows.Add();
     // Add a Table cell to cells collection of row
     Aspose.Pdf.Cell cell = row.Cells.Add("some text");
     // Set the border for cell object (double border)
     cell.Border = border;
     // Add table to paragraphs collection of Page
     page.Paragraphs.Add(table);
     dataDir = dataDir + "TableBorderTest_out.pdf";
     // Save the PDF document
     doc.Save(dataDir);
     // ExEnd:SetBorder
     Console.WriteLine("\nBorder setup successfully.\nFile saved at " + dataDir);
     
 }
        public static void Run()
        {
            // ExStart:SetBorder
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdf_Tables();

            // Instantiate Document object
            Document doc = new Document();
            // Add page to PDF document
            Page page = doc.Pages.Add();

            // Create BorderInfo object
            Aspose.Pdf.BorderInfo border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All);
            // Specify that Top border will be double
            border.Top.IsDoubled = true;
            // Specify that bottom border will be double
            border.Bottom.IsDoubled = true;
            // Instantiate Table object
            Aspose.Pdf.Table table = new Aspose.Pdf.Table();
            // Specify Columns width information
            table.ColumnWidths = "100";
            // Create Row object
            Aspose.Pdf.Row row = table.Rows.Add();
            // Add a Table cell to cells collection of row
            Aspose.Pdf.Cell cell = row.Cells.Add("some text");
            // Set the border for cell object (double border)
            cell.Border = border;
            // Add table to paragraphs collection of Page
            page.Paragraphs.Add(table);
            dataDir = dataDir + "TableBorderTest_out_.pdf";
            // Save the PDF document
            doc.Save(dataDir);
            // ExEnd:SetBorder
            Console.WriteLine("\nBorder setup successfully.\nFile saved at " + dataDir);
        }
Beispiel #3
0
        public static void Main(string[] args)
        {
            // The path to the documents directory.
            string dataDir = Path.GetFullPath("../../../Data/");
            // Create directory if it is not already present.
            bool IsExists = System.IO.Directory.Exists(dataDir);

            if (!IsExists)
            {
                System.IO.Directory.CreateDirectory(dataDir);
            }


            // instantiate Document object
            Document doc = new Document();
            // add page to PDF document
            Page page = doc.Pages.Add();

            // create BorderInfo object
            Aspose.Pdf.BorderInfo border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All);
            // specify that Top border will be double
            border.Top.IsDoubled = true;
            // specify that bottom border will be double
            border.Bottom.IsDoubled = true;
            // instantiate Table object
            Aspose.Pdf.Table table = new Aspose.Pdf.Table();
            // specify Columns width information
            table.ColumnWidths = "100";
            // create Row object
            Aspose.Pdf.Row row = table.Rows.Add();
            // add a Table cell to cells collection of row
            Aspose.Pdf.Cell cell = row.Cells.Add("some text");
            // set the border for cell object (double border)
            cell.Border = border;
            // add table to paragraphs collection of Page
            page.Paragraphs.Add(table);
            // save the PDF document
            doc.Save(dataDir + "TableBorderTest.pdf");
        }
Beispiel #4
0
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdf_Tables();
            // Create directory if it is not already present.
            bool IsExists = System.IO.Directory.Exists(dataDir);
            if (!IsExists)
                System.IO.Directory.CreateDirectory(dataDir);


            // instantiate Document object
            Document doc = new Document();
            // add page to PDF document
            Page page = doc.Pages.Add();
            // create BorderInfo object
            Aspose.Pdf.BorderInfo border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All);
            // specify that Top border will be double
            border.Top.IsDoubled = true;
            // specify that bottom border will be double
            border.Bottom.IsDoubled = true;
            // instantiate Table object
            Aspose.Pdf.Table table = new Aspose.Pdf.Table();
            // specify Columns width information
            table.ColumnWidths = "100";
            // create Row object
            Aspose.Pdf.Row row = table.Rows.Add();
            // add a Table cell to cells collection of row
            Aspose.Pdf.Cell cell = row.Cells.Add("some text");
            // set the border for cell object (double border)
            cell.Border = border;
            // add table to paragraphs collection of Page
            page.Paragraphs.Add(table);
            // save the PDF document
            doc.Save(dataDir+ "TableBorderTest.pdf");
            
            
        }