asponse.words 插入文字 图片

来源:互联网 发布:下载影视新势力软件 编辑:程序博客网 时间:2024/06/04 20:13
            Document doc = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);
            builder.CellFormat.VerticalAlignment = CellVerticalAlignment.Center;
            builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
            builder.MoveToParagraph(0,0);
            //字体大小  
            builder.Font.Size = 10; ; 
            //是否加粗  
            builder.Bold = false;
            builder.Write("标题");
            //插入段落
            builder.InsertParagraph();
            builder.MoveToParagraph(1, 0);
            Shape shape = new Shape(doc, ShapeType.Image);
            shape.ImageData.SetImage("E:\\timg.jpg");
            shape.Width = 70;
            shape.Height = 70;
            shape.HorizontalAlignment = HorizontalAlignment.Right; //靠右对齐


            builder.InsertNode(shape);
            doc.Save("E:\\test.doc");
0 0