当前位置: 首页>>代码示例>>C#>>正文


C# TextDocument.SaveTo方法代码示例

本文整理汇总了C#中AODL.Document.TextDocuments.TextDocument.SaveTo方法的典型用法代码示例。如果您正苦于以下问题:C# TextDocument.SaveTo方法的具体用法?C# TextDocument.SaveTo怎么用?C# TextDocument.SaveTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AODL.Document.TextDocuments.TextDocument的用法示例。


在下文中一共展示了TextDocument.SaveTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ODFFrameTest

		public void ODFFrameTest()
		{
			//Create a new text document
			TextDocument document					= new TextDocument();
			document.New();
			
			// Create a main paragraph
			Paragraph p =new Paragraph(document);
			// Create a main form
			ODFForm main_form = new ODFForm(document, "mainform");
			main_form.Method = Method.Get;
			
			// Create a frame
			ODFFrame frm = new ODFFrame(main_form, p.Content, "frm", "5mm", "5mm", "5cm", "3cm");
			frm.Label = "ODFFrame test";
			// Add the frame to the form control list
			main_form.Controls.Add (frm);
			
			// Create a button
			ODFButton butt = new ODFButton(main_form, p.Content, "butt", "1cm", "15mm", "4cm", "1cm");
			butt.Label = "A simple button :)";
			// Add the button to the form control list
			main_form.Controls.Add (butt);

			// Add the forms to the document!
			document.Forms.Add(main_form);
			// Add the paragraph to the content list
			document.Content.Add(p);

			document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"frame_test.odt");
			document.Load(AARunMeFirstAndOnce.outPutFolder+"frame_test.odt");
			document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"frame_test2.odt");
		}
开发者ID:rabidbob,项目名称:aodl-reloaded,代码行数:33,代码来源:ODFFormsTest.cs

示例2: Example3

 void Example3()
 {
     string imagePath = @"Assets\ODFSample\Examples\example3.png";
     TextDocument document = new TextDocument();
     document.New();
     //Create standard paragraph
     Paragraph paragraphOuter = ParagraphBuilder.CreateStandardTextParagraph(document);
     //Create the frame with graphic
     Frame frame = new Frame(document, "frame1", "graphic1", imagePath);
     //Create a Draw Area Rectangle
     DrawAreaRectangle drawAreaRec = new DrawAreaRectangle(
         document, "0cm", "0cm", "1.5cm", "2.5cm", null);
     drawAreaRec.Href = "http://OpenDocument4all.com";
     //Create a Draw Area Circle
     DrawAreaCircle drawAreaCircle = new DrawAreaCircle(
         document, "4cm", "4cm", "1.5cm", null);
     drawAreaCircle.Href = "http://AODL.OpenDocument4all.com";
     DrawArea[] drawArea = new DrawArea[2] { drawAreaRec, drawAreaCircle };
     //Create a Image Map
     ImageMap imageMap = new ImageMap(document, drawArea);
     //Add Image Map to the frame
     frame.Content.Add(imageMap);
     //Add frame to paragraph
     paragraphOuter.Content.Add(frame);
     //Add paragraph to document
     document.Content.Add(paragraphOuter);
     //Save the document
     document.SaveTo(@"example3_simpleImageMap.odt");
 }
开发者ID:hebory,项目名称:aodl-examples-for-unity,代码行数:29,代码来源:Example3.cs

示例3: Example6

    void Example6()
    {
        //Create a new text document
        TextDocument document = new TextDocument();
        document.New();
        //Create a table for a text document using the TableBuilder
        Table table = TableBuilder.CreateTextDocumentTable(
            document,
            "table1",
            "table1",
            3,
            3,
            16.99,
            false,
            false);

        //Fill the cells
        foreach (Row row in table.RowCollection)
        {
            foreach (Cell cell in row.CellCollection)
            {
                //Create a standard paragraph
                Paragraph paragraph = ParagraphBuilder.CreateStandardTextParagraph(document);
                //Add some simple text
                paragraph.TextContent.Add(new SimpleText(document, "Cell text"));
                cell.Content.Add(paragraph);
            }
        }
        //Merge some cells. Notice this is only available in text documents!
        table.RowCollection[1].MergeCells(document, 1, 2, true);
        //Add table to the document
        document.Content.Add(table);
        //Save the document
        document.SaveTo("example6_simpleTableWithMergedCells.odt");
    }
开发者ID:hebory,项目名称:aodl-examples-for-unity,代码行数:35,代码来源:Example6.cs

示例4: Example10

    void Example10()
    {
        //some text e.g read from a TextBox
        string someText = "Max Mustermann\nMustermann Str. 300\n22222 Hamburg\n\n\n\n"
                                + "Heinz Willi\nDorfstr. 1\n22225 Hamburg\n\n\n\n"
                                + "Offer for 200 Intel Pentium 4 CPU's\n\n\n\n"
                                + "Dear Mr. Willi,\n\n\n\n"
                                + "thank you for your request. \tWe can "
                                + "offer you the 200 Intel Pentium IV 3 Ghz CPU's for a price of "
                                + "79,80 € per unit."
                                + "This special offer is valid to 31.10.2005. If you accept, we "
                                + "can deliver within 24 hours.\n\n\n\n"
                                + "Best regards \nMax Mustermann";

        //Create new TextDocument
        TextDocument document = new TextDocument();
        document.New();
        //Use the ParagraphBuilder to split the string into ParagraphCollection
        ParagraphCollection pCollection = ParagraphBuilder.CreateParagraphCollection(
                                             document,
                                             someText,
                                             true,
                                             ParagraphBuilder.ParagraphSeperator);
        //Add the paragraph collection
        foreach (Paragraph paragraph in pCollection)
            document.Content.Add(paragraph);
        //save
        document.SaveTo("example10_Letter.odt");
    }
开发者ID:hebory,项目名称:aodl-examples-for-unity,代码行数:29,代码来源:Example10.cs

示例5: Example7

 void Example7()
 {
     //Create a new text document
     TextDocument document = new TextDocument();
     document.New();
     //Create a table for a text document using the TableBuilder
     Table table = TableBuilder.CreateTextDocumentTable(
         document,
         "table1",
         "table1",
         3,
         3,
         16.99,
         false,
         false);
     //Create a standard paragraph
     Paragraph paragraph = ParagraphBuilder.CreateStandardTextParagraph(document);
     //Add some simple text
     paragraph.TextContent.Add(new SimpleText(document, "Some cell text"));
     //Insert paragraph into the first cell
     table.RowCollection[0].CellCollection[0].Content.Add(paragraph);
     //Add table to the document
     document.Content.Add(table);
     //Save the document
     document.SaveTo("example7_simpleTable.odt");
 }
开发者ID:hebory,项目名称:aodl-examples-for-unity,代码行数:26,代码来源:Example7.cs

示例6: Example4

 void Example4()
 {
     string imagePath = @"Assets\ODFSample\Examples\example3.png";
     TextDocument textdocument = new TextDocument();
     textdocument.New();
     Paragraph pOuter = ParagraphBuilder.CreateStandardTextParagraph(textdocument);
     DrawTextBox drawTextBox = new DrawTextBox(textdocument);
     Frame frameTextBox = new Frame(textdocument, "fr_txt_box");
     frameTextBox.DrawName = "fr_txt_box";
     frameTextBox.ZIndex = "0";
     Paragraph p = ParagraphBuilder.CreateStandardTextParagraph(textdocument);
     p.StyleName = "Illustration";
     Frame frame = new Frame(textdocument, "frame1", "graphic1", imagePath);
     frame.ZIndex = "1";
     p.Content.Add(frame);
     p.TextContent.Add(new SimpleText(textdocument, "Illustration"));
     drawTextBox.Content.Add(p);
     frameTextBox.SvgWidth = frame.SvgWidth;
     drawTextBox.MinWidth = frame.SvgWidth;
     drawTextBox.MinHeight = frame.SvgHeight;
     frameTextBox.Content.Add(drawTextBox);
     pOuter.Content.Add(frameTextBox);
     textdocument.Content.Add(pOuter);
     textdocument.SaveTo("example4_drawTextbox.odt");
 }
开发者ID:hebory,项目名称:aodl-examples-for-unity,代码行数:25,代码来源:Example4.cs

示例7: CreateNewDocumentAndDoAPrintOut

		public void CreateNewDocumentAndDoAPrintOut()
		{
			string fileToPrint						= AARunMeFirstAndOnce.outPutFolder+"fileToPrint.odt";

			//Create a new text document
			TextDocument document					= new TextDocument();
			document.New();
			//Create a standard paragraph using the ParagraphBuilder
			Paragraph paragraph						= ParagraphBuilder.CreateStandardTextParagraph(document);
			//Add some simple text
			paragraph.TextContent.Add(new SimpleText(document, "Some simple text!"));
			//Add the paragraph to the document
			document.Content.Add(paragraph);
			//Save empty
			document.SaveTo(fileToPrint);

			//Now print the new document via the OpenOfficeLib
			//Get the Component Context
			XComponentContext xComponentContext			= Connector.GetComponentContext();
			//Get a MultiServiceFactory
			XMultiServiceFactory xMultiServiceFactory	= Connector.GetMultiServiceFactory(xComponentContext);
			//Get a Dektop instance		
			XDesktop xDesktop							= Connector.GetDesktop(xMultiServiceFactory);
			//Convert a windows path to an OpenOffice one
			fileToPrint						= Component.PathConverter(fileToPrint);
			//Load the document you want to print
			XComponent xComponent						= Component.LoadDocument(
				(XComponentLoader)xDesktop, fileToPrint, "_blank");
			//Print the XComponent
			Printer.Print(xComponent);
		}
开发者ID:rabidbob,项目名称:aodl-reloaded,代码行数:31,代码来源:OpenOfficeLibTests.cs

示例8: EmptyDocument

 public void EmptyDocument()
 {
     //Create a new text document
     var document					= new TextDocument();
     document.New();
     //Save empty
     document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"empty.odt");
 }
开发者ID:stuzzicadenti,项目名称:aodl,代码行数:8,代码来源:TextDocumentBaseTests.cs

示例9: HTMLExportTest2

 public void HTMLExportTest2()
 {
     string file							= [email protected]"OpenOffice.net.odt";
     FileInfo fInfo						= new FileInfo(file);
     //Load a text document
     TextDocument textDocument			= new TextDocument();
     textDocument.Load(file);
     //Save it back again
     textDocument.SaveTo(AARunMeFirstAndOnce.outPutFolder+fInfo.Name+".html");
 }
开发者ID:stuzzicadenti,项目名称:aodl,代码行数:10,代码来源:HTMLExportTest.cs

示例10: SimpleTocLoadTest

		public void SimpleTocLoadTest()
		{
			string file							= [email protected]"simple_toc.odt";
			FileInfo fInfo						= new FileInfo(file);
			//Load a text document
			TextDocument textDocument			= new TextDocument();
			textDocument.Load(file);
			//Save it back again
			textDocument.SaveTo(AARunMeFirstAndOnce.outPutFolder+fInfo.Name+".rel.odt");
		}
开发者ID:rabidbob,项目名称:aodl-reloaded,代码行数:10,代码来源:DocumentImportTest.cs

示例11: Example5

 void Example5()
 {
     TextDocument textdocument = new TextDocument();
     textdocument.New();
     Paragraph p = ParagraphBuilder.CreateStandardTextParagraph(textdocument);
     Frame frame = new Frame(textdocument, "frame1", "graphic1", @"Assets\ODFSample\Examples\example3.png");
     p.Content.Add(frame);
     textdocument.Content.Add(p);
     textdocument.SaveTo("example5_grapic.odt");
 }
开发者ID:hebory,项目名称:aodl-examples-for-unity,代码行数:10,代码来源:Example5.cs

示例12: GraphicsTest

		public void GraphicsTest()
		{
			TextDocument textdocument		= new TextDocument();
			textdocument.New();
			Paragraph p						= ParagraphBuilder.CreateStandardTextParagraph(textdocument);
			Frame frame						= new Frame(textdocument, "frame1",
				"graphic1", _imagefile);
			p.Content.Add(frame);
			textdocument.Content.Add(p);
			textdocument.SaveTo(AARunMeFirstAndOnce.outPutFolder+"grapic.odt");
		}
开发者ID:rabidbob,项目名称:aodl-reloaded,代码行数:11,代码来源:GraphicTest.cs

示例13: SimpleLoadTest

		public void SimpleLoadTest()
		{
			string file							= [email protected]"hallo.odt";
			FileInfo fInfo						= new FileInfo(file);
			//Load a text document
			TextDocument textDocument			= new TextDocument();
			textDocument.Load(file);
			Assert.IsTrue(textDocument.CommonStyles.Count > 0, "Common Styles must be read!");
			Console.WriteLine("Common styles: {0}", textDocument.CommonStyles.Count);
			//Save it back again
			textDocument.SaveTo(AARunMeFirstAndOnce.outPutFolder+fInfo.Name+".rel.odt");
		}
开发者ID:rabidbob,项目名称:aodl-reloaded,代码行数:12,代码来源:DocumentImportTest.cs

示例14: Example16

 void Example16()
 {
     //Create a new text document
     TextDocument document = new TextDocument();
     document.New();
     //Create a standard paragraph using the ParagraphBuilder
     Paragraph paragraph = ParagraphBuilder.CreateStandardTextParagraph(document);
     //Add some simple text
     paragraph.TextContent.Add(new SimpleText(document, "Some simple text!"));
     //Add the paragraph to the document
     document.Content.Add(paragraph);
     //Save
     document.SaveTo("example16_simple.odt");
 }
开发者ID:hebory,项目名称:aodl-examples-for-unity,代码行数:14,代码来源:Example16.cs

示例15: ParagraphSimpleText

		public void ParagraphSimpleText()
		{
			//Create a new text document
			TextDocument document					= new TextDocument();
			document.New();
			//Create a standard paragraph using the ParagraphBuilder
			Paragraph paragraph						= ParagraphBuilder.CreateStandardTextParagraph(document);
			//Add some simple text
			paragraph.TextContent.Add(new SimpleText(document, "Some simple text!"));
			//Add the paragraph to the document
			document.Content.Add(paragraph);
			//Save empty
			document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"simple.odt");
		}
开发者ID:rabidbob,项目名称:aodl-reloaded,代码行数:14,代码来源:TextDocumentBaseTests.cs


注:本文中的AODL.Document.TextDocuments.TextDocument.SaveTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。