Beispiel #1
0
        private void DocumentBuilder_4()
        {
            //create filename of pdf_file_tosave
            var word_file_tosave = @"d:\1.docx";

            //new pdf doc
            //var word_doc = new Aspose.Words.Document();
            Aspose.Words.DocumentBuilder builder1 = new Aspose.Words.DocumentBuilder();
            builder1.InsertHtml("<H1>this is a testing!</H1>");
            var rhp = new Aspose.Words.Drawing.RelativeHorizontalPosition();
            var rvp = new Aspose.Words.Drawing.RelativeVerticalPosition();

            builder1.InsertShape(Aspose.Words.Drawing.ShapeType.StraightConnector1, rhp, 10, rvp, 10, 300, 300, Aspose.Words.Drawing.WrapType.None);
            builder1.InsertShape(Aspose.Words.Drawing.ShapeType.CurvedConnector3, rhp, 10, rvp, 10, 200, 300, Aspose.Words.Drawing.WrapType.None);
            builder1.InsertShape(Aspose.Words.Drawing.ShapeType.CurvedConnector4, rhp, 10, rvp, 10, 100, 300, Aspose.Words.Drawing.WrapType.None);
            builder1.InsertShape(Aspose.Words.Drawing.ShapeType.CurvedConnector5, rhp, 10, rvp, 10, 50, 300, Aspose.Words.Drawing.WrapType.None);

            //save
            try
            {
                //word_doc.Save(word_file_tosave, Aspose.Words.SaveFormat.Docx);
                builder1.Document.Save(word_file_tosave, Aspose.Words.SaveFormat.Docx);
                MessageBox.Show("Save Successfully!");
                //pdfDoc.Dispose();
                Process.Start(word_file_tosave);
            }
            catch
            {
                MessageBox.Show("Faild to Save!");
            }
        }