Esempio n. 1
0
        public void PageBorderProperties()
        {
            //ExStart
            //ExFor:Section.PageSetup
            //ExFor:PageSetup.BorderAlwaysInFront
            //ExFor:PageSetup.BorderDistanceFrom
            //ExFor:PageSetup.BorderAppliesTo
            //ExFor:PageBorderDistanceFrom
            //ExFor:PageBorderAppliesTo
            //ExFor:Border.DistanceFromText
            //ExSummary:Creates a page border that looks like a wide blue band at the top of the first page only.
            Aspose.Words.Document doc = new Aspose.Words.Document();

            Aspose.Words.PageSetup ps = doc.Sections[0].PageSetup;
            ps.BorderAlwaysInFront = false;
            ps.BorderDistanceFrom  = PageBorderDistanceFrom.PageEdge;
            ps.BorderAppliesTo     = PageBorderAppliesTo.FirstPage;

            Aspose.Words.Border border = ps.Borders[BorderType.Top];
            border.LineStyle        = LineStyle.Single;
            border.LineWidth        = 30;
            border.Color            = System.Drawing.Color.Blue;
            border.DistanceFromText = 0;

            doc.Save(MyDir + "PageSetup.PageBorderTop Out.doc");
            //ExEnd
        }
Esempio n. 2
0
        public void ParagraphTopBorder()
        {
            //ExStart
            //ExFor:BorderCollection
            //ExFor:Border
            //ExFor:BorderType
            //ExFor:DocumentBuilder.ParagraphFormat
            //ExFor:DocumentBuilder.Writeln(String)
            //ExSummary:Inserts a paragraph with a top border.
            DocumentBuilder builder = new DocumentBuilder();

            Aspose.Words.Border topBorder = builder.ParagraphFormat.Borders[BorderType.Top];
            topBorder.Color     = System.Drawing.Color.Red;
            topBorder.LineStyle = LineStyle.DashSmallGap;
            topBorder.LineWidth = 4;

            builder.Writeln("Hello World!");
            //ExEnd
        }