jiahaochen666 / CS131

0 stars 0 forks source link

TODO #1

Open jiahaochen666 opened 1 month ago

jiahaochen666 commented 1 month ago

using DocumentFormat.OpenXml.Wordprocessing; using DocumentFormat.OpenXml; using Wp = DocumentFormat.OpenXml.Drawing.Wordprocessing; using A = DocumentFormat.OpenXml.Drawing; using Wps = DocumentFormat.OpenXml.Office2010.Word.DrawingShape; using Wp14 = DocumentFormat.OpenXml.Office2010.Word.Drawing; using V = DocumentFormat.OpenXml.Vml; using Ovml = DocumentFormat.OpenXml.Vml.Office; using Wvml = DocumentFormat.OpenXml.Vml.Wordprocessing;

namespace GeneratedCode { public class GeneratedClass { // Creates an Document instance and adds its children. public Document GenerateDocument() { Document document1 = new Document(){ MCAttributes = new MarkupCompatibilityAttributes(){ Ignorable = "w14 w15 w16se w16cid w16 w16cex w16sdtdh wp14" } }; document1.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"); document1.AddNamespaceDeclaration("cx", "http://schemas.microsoft.com/office/drawing/2014/chartex"); document1.AddNamespaceDeclaration("cx1", "http://schemas.microsoft.com/office/drawing/2015/9/8/chartex"); document1.AddNamespaceDeclaration("cx2", "http://schemas.microsoft.com/office/drawing/2015/10/21/chartex"); document1.AddNamespaceDeclaration("cx3", "http://schemas.microsoft.com/office/drawing/2016/5/9/chartex"); document1.AddNamespaceDeclaration("cx4", "http://schemas.microsoft.com/office/drawing/2016/5/10/chartex"); document1.AddNamespaceDeclaration("cx5", "http://schemas.microsoft.com/office/drawing/2016/5/11/chartex"); document1.AddNamespaceDeclaration("cx6", "http://schemas.microsoft.com/office/drawing/2016/5/12/chartex"); document1.AddNamespaceDeclaration("cx7", "http://schemas.microsoft.com/office/drawing/2016/5/13/chartex"); document1.AddNamespaceDeclaration("cx8", "http://schemas.microsoft.com/office/drawing/2016/5/14/chartex"); document1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006"); document1.AddNamespaceDeclaration("aink", "http://schemas.microsoft.com/office/drawing/2016/ink"); document1.AddNamespaceDeclaration("am3d", "http://schemas.microsoft.com/office/drawing/2017/model3d"); document1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office"); document1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"); document1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math"); document1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml"); document1.AddNamespaceDeclaration("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"); document1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"); document1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word"); document1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main"); document1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml"); document1.AddNamespaceDeclaration("w15", "http://schemas.microsoft.com/office/word/2012/wordml"); document1.AddNamespaceDeclaration("w16cex", "http://schemas.microsoft.com/office/word/2018/wordml/cex"); document1.AddNamespaceDeclaration("w16cid", "http://schemas.microsoft.com/office/word/2016/wordml/cid"); document1.AddNamespaceDeclaration("w16", "http://schemas.microsoft.com/office/word/2018/wordml"); document1.AddNamespaceDeclaration("w16sdtdh", "http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash"); document1.AddNamespaceDeclaration("w16se", "http://schemas.microsoft.com/office/word/2015/wordml/symex"); document1.AddNamespaceDeclaration("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"); document1.AddNamespaceDeclaration("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk"); document1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml"); document1.AddNamespaceDeclaration("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");

        Body body1 = new Body();

        Paragraph paragraph1 = new Paragraph(){ RsidParagraphAddition = "0054549F", RsidRunAdditionDefault = "00F8046C", ParagraphId = "538EDBB6", TextId = "472A06CE" };

        Run run1 = new Run();

        RunProperties runProperties1 = new RunProperties();
        NoProof noProof1 = new NoProof();

        runProperties1.Append(noProof1);

        AlternateContent alternateContent1 = new AlternateContent();

        AlternateContentChoice alternateContentChoice1 = new AlternateContentChoice(){ Requires = "wps" };

        Drawing drawing1 = new Drawing();

        Wp.Anchor anchor1 = new Wp.Anchor(){ DistanceFromTop = (UInt32Value)45720U, DistanceFromBottom = (UInt32Value)45720U, DistanceFromLeft = (UInt32Value)114300U, DistanceFromRight = (UInt32Value)114300U, SimplePos = false, RelativeHeight = (UInt32Value)251659264U, BehindDoc = false, Locked = false, LayoutInCell = true, AllowOverlap = true, EditId = "401C7566", AnchorId = "3253DA63" };
        Wp.SimplePosition simplePosition1 = new Wp.SimplePosition(){ X = 0L, Y = 0L };

        Wp.HorizontalPosition horizontalPosition1 = new Wp.HorizontalPosition(){ RelativeFrom = Wp.HorizontalRelativePositionValues.Column };
        Wp.PositionOffset positionOffset1 = new Wp.PositionOffset();
        positionOffset1.Text = "2338253";

        horizontalPosition1.Append(positionOffset1);

        Wp.VerticalPosition verticalPosition1 = new Wp.VerticalPosition(){ RelativeFrom = Wp.VerticalRelativePositionValues.Paragraph };
        Wp.PositionOffset positionOffset2 = new Wp.PositionOffset();
        positionOffset2.Text = "1208277";

        verticalPosition1.Append(positionOffset2);
        Wp.Extent extent1 = new Wp.Extent(){ Cx = 2360930L, Cy = 1404620L };
        Wp.EffectExtent effectExtent1 = new Wp.EffectExtent(){ LeftEdge = 0L, TopEdge = 0L, RightEdge = 22860L, BottomEdge = 11430L };
        Wp.WrapSquare wrapSquare1 = new Wp.WrapSquare(){ WrapText = Wp.WrapTextValues.BothSides };
        Wp.DocProperties docProperties1 = new Wp.DocProperties(){ Id = (UInt32Value)217U, Name = "文本框 2" };

        Wp.NonVisualGraphicFrameDrawingProperties nonVisualGraphicFrameDrawingProperties1 = new Wp.NonVisualGraphicFrameDrawingProperties();

        A.GraphicFrameLocks graphicFrameLocks1 = new A.GraphicFrameLocks();
        graphicFrameLocks1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");

        nonVisualGraphicFrameDrawingProperties1.Append(graphicFrameLocks1);

        A.Graphic graphic1 = new A.Graphic();
        graphic1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");

        A.GraphicData graphicData1 = new A.GraphicData(){ Uri = "http://schemas.microsoft.com/office/word/2010/wordprocessingShape" };

        Wps.WordprocessingShape wordprocessingShape1 = new Wps.WordprocessingShape();

        Wps.NonVisualDrawingShapeProperties nonVisualDrawingShapeProperties1 = new Wps.NonVisualDrawingShapeProperties(){ TextBox = true };
        A.ShapeLocks shapeLocks1 = new A.ShapeLocks(){ NoChangeArrowheads = true };

        nonVisualDrawingShapeProperties1.Append(shapeLocks1);

        Wps.ShapeProperties shapeProperties1 = new Wps.ShapeProperties(){ BlackWhiteMode = A.BlackWhiteModeValues.Auto };

        A.Transform2D transform2D1 = new A.Transform2D();
        A.Offset offset1 = new A.Offset(){ X = 0L, Y = 0L };
        A.Extents extents1 = new A.Extents(){ Cx = 2360930L, Cy = 1404620L };

        transform2D1.Append(offset1);
        transform2D1.Append(extents1);

        A.PresetGeometry presetGeometry1 = new A.PresetGeometry(){ Preset = A.ShapeTypeValues.Rectangle };
        A.AdjustValueList adjustValueList1 = new A.AdjustValueList();

        presetGeometry1.Append(adjustValueList1);

        A.SolidFill solidFill1 = new A.SolidFill();
        A.RgbColorModelHex rgbColorModelHex1 = new A.RgbColorModelHex(){ Val = "FFFFFF" };

        solidFill1.Append(rgbColorModelHex1);

        A.Outline outline1 = new A.Outline(){ Width = 9525 };

        A.SolidFill solidFill2 = new A.SolidFill();
        A.RgbColorModelHex rgbColorModelHex2 = new A.RgbColorModelHex(){ Val = "000000" };

        solidFill2.Append(rgbColorModelHex2);
        A.Miter miter1 = new A.Miter(){ Limit = 800000 };
        A.HeadEnd headEnd1 = new A.HeadEnd();
        A.TailEnd tailEnd1 = new A.TailEnd();

        outline1.Append(solidFill2);
        outline1.Append(miter1);
        outline1.Append(headEnd1);
        outline1.Append(tailEnd1);

        shapeProperties1.Append(transform2D1);
        shapeProperties1.Append(presetGeometry1);
        shapeProperties1.Append(solidFill1);
        shapeProperties1.Append(outline1);

        Wps.TextBoxInfo2 textBoxInfo21 = new Wps.TextBoxInfo2();

        TextBoxContent textBoxContent1 = new TextBoxContent();

        Paragraph paragraph2 = new Paragraph(){ RsidParagraphAddition = "00F8046C", RsidRunAdditionDefault = "00F8046C", ParagraphId = "667A1055", TextId = "74C1515B" };

        Run run2 = new Run();
        Text text1 = new Text(){ Space = SpaceProcessingModeValues.Preserve };
        text1.Text = "I ";

        run2.Append(text1);
        ProofError proofError1 = new ProofError(){ Type = ProofingErrorValues.SpellStart };

        Run run3 = new Run();
        Text text2 = new Text();
        text2.Text = "wanna";

        run3.Append(text2);
        ProofError proofError2 = new ProofError(){ Type = ProofingErrorValues.SpellEnd };

        Run run4 = new Run();
        Text text3 = new Text(){ Space = SpaceProcessingModeValues.Preserve };
        text3.Text = " fuck u";

        run4.Append(text3);

        paragraph2.Append(run2);
        paragraph2.Append(proofError1);
        paragraph2.Append(run3);
        paragraph2.Append(proofError2);
        paragraph2.Append(run4);

        textBoxContent1.Append(paragraph2);

        textBoxInfo21.Append(textBoxContent1);

        Wps.TextBodyProperties textBodyProperties1 = new Wps.TextBodyProperties(){ Rotation = 0, Vertical = A.TextVerticalValues.Horizontal, Wrap = A.TextWrappingValues.Square, LeftInset = 91440, TopInset = 45720, RightInset = 91440, BottomInset = 45720, Anchor = A.TextAnchoringTypeValues.Top, AnchorCenter = false };
        A.ShapeAutoFit shapeAutoFit1 = new A.ShapeAutoFit();

        textBodyProperties1.Append(shapeAutoFit1);

        wordprocessingShape1.Append(nonVisualDrawingShapeProperties1);
        wordprocessingShape1.Append(shapeProperties1);
        wordprocessingShape1.Append(textBoxInfo21);
        wordprocessingShape1.Append(textBodyProperties1);

        graphicData1.Append(wordprocessingShape1);

        graphic1.Append(graphicData1);

        Wp14.RelativeWidth relativeWidth1 = new Wp14.RelativeWidth(){ ObjectId = Wp14.SizeRelativeHorizontallyValues.Margin };
        Wp14.PercentageWidth percentageWidth1 = new Wp14.PercentageWidth();
        percentageWidth1.Text = "40000";

        relativeWidth1.Append(percentageWidth1);

        Wp14.RelativeHeight relativeHeight1 = new Wp14.RelativeHeight(){ RelativeFrom = Wp14.SizeRelativeVerticallyValues.Margin };
        Wp14.PercentageHeight percentageHeight1 = new Wp14.PercentageHeight();
        percentageHeight1.Text = "20000";

        relativeHeight1.Append(percentageHeight1);

        anchor1.Append(simplePosition1);
        anchor1.Append(horizontalPosition1);
        anchor1.Append(verticalPosition1);
        anchor1.Append(extent1);
        anchor1.Append(effectExtent1);
        anchor1.Append(wrapSquare1);
        anchor1.Append(docProperties1);
        anchor1.Append(nonVisualGraphicFrameDrawingProperties1);
        anchor1.Append(graphic1);
        anchor1.Append(relativeWidth1);
        anchor1.Append(relativeHeight1);

        drawing1.Append(anchor1);

        alternateContentChoice1.Append(drawing1);

        AlternateContentFallback alternateContentFallback1 = new AlternateContentFallback();

        Picture picture1 = new Picture();

        V.Shapetype shapetype1 = new V.Shapetype(){ Id = "_x0000_t202", CoordinateSize = "21600,21600", OptionalNumber = 202, EdgePath = "m,l,21600r21600,l21600,xe" };
        shapetype1.SetAttribute(new OpenXmlAttribute("w14", "anchorId", "http://schemas.microsoft.com/office/word/2010/wordml", "3253DA63"));
        V.Stroke stroke1 = new V.Stroke(){ JoinStyle = V.StrokeJoinStyleValues.Miter };
        V.Path path1 = new V.Path(){ AllowGradientShape = true, ConnectionPointType = Ovml.ConnectValues.Rectangle };

        shapetype1.Append(stroke1);
        shapetype1.Append(path1);

        V.Shape shape1 = new V.Shape(){ Id = "文本框 2", Style = "position:absolute;left:0;text-align:left;margin-left:184.1pt;margin-top:95.15pt;width:185.9pt;height:110.6pt;z-index:251659264;visibility:visible;mso-wrap-style:square;mso-width-percent:400;mso-height-percent:200;mso-wrap-distance-left:9pt;mso-wrap-distance-top:3.6pt;mso-wrap-distance-right:9pt;mso-wrap-distance-bottom:3.6pt;mso-position-horizontal:absolute;mso-position-horizontal-relative:text;mso-position-vertical:absolute;mso-position-vertical-relative:text;mso-width-percent:400;mso-height-percent:200;mso-width-relative:margin;mso-height-relative:margin;v-text-anchor:top", OptionalString = "_x0000_s1026", Type = "#_x0000_t202", EncodedPackage = "UEsDBBQABgAIAAAAIQC2gziS/gAAAOEBAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbJSRQU7DMBBF\n90jcwfIWJU67QAgl6YK0S0CoHGBkTxKLZGx5TGhvj5O2G0SRWNoz/78nu9wcxkFMGNg6quQqL6RA\n0s5Y6ir5vt9lD1JwBDIwOMJKHpHlpr69KfdHjyxSmriSfYz+USnWPY7AufNIadK6MEJMx9ApD/oD\nOlTrorhX2lFEilmcO2RdNtjC5xDF9pCuTyYBB5bi6bQ4syoJ3g9WQ0ymaiLzg5KdCXlKLjvcW893\nSUOqXwnz5DrgnHtJTxOsQfEKIT7DmDSUCaxw7Rqn8787ZsmRM9e2VmPeBN4uqYvTtW7jvijg9N/y\nJsXecLq0q+WD6m8AAAD//wMAUEsDBBQABgAIAAAAIQA4/SH/1gAAAJQBAAALAAAAX3JlbHMvLnJl\nbHOkkMFqwzAMhu+DvYPRfXGawxijTi+j0GvpHsDYimMaW0Yy2fr2M4PBMnrbUb/Q94l/f/hMi1qR\nJVI2sOt6UJgd+ZiDgffL8ekFlFSbvV0oo4EbChzGx4f9GRdb25HMsYhqlCwG5lrLq9biZkxWOiqY\n22YiTra2kYMu1l1tQD30/bPm3wwYN0x18gb45AdQl1tp5j/sFB2T0FQ7R0nTNEV3j6o9feQzro1i\nOWA14Fm+Q8a1a8+Bvu/d/dMb2JY5uiPbhG/ktn4cqGU/er3pcvwCAAD//wMAUEsDBBQABgAIAAAA\nIQAIDNe8NgIAAEgEAAAOAAAAZHJzL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y9WXZPwKJe4h8Mv/qkDhU5nf3kVGBGwjrfpIRS8CjWwIh4yAStO0vIkuQeeFXy\n/xuqHwAAAP//AwBQSwECLQAUAAYACAAAACEAtoM4kv4AAADhAQAAEwAAAAAAAAAAAAAAAAAAAAAA\nW0NvbnRlbnRfVHlwZXNdLnhtbFBLAQItABQABgAIAAAAIQA4/SH/1gAAAJQBAAALAAAAAAAAAAAA\nAAAAAC8BAABfcmVscy8ucmVsc1BLAQItABQABgAIAAAAIQAIDNe8NgIAAEgEAAAOAAAAAAAAAAAA\nAAAAAC4CAABkcnMvZTJvRG9jLnhtbFBLAQItABQABgAIAAAAIQDeX99J3wAAAAsBAAAPAAAAAAAA\nAAAAAAAAAJAEAABkcnMvZG93bnJldi54bWxQSwUGAAAAAAQABADzAAAAnAUAAAAA\n" };

        V.TextBox textBox1 = new V.TextBox(){ Style = "mso-fit-shape-to-text:t" };

        TextBoxContent textBoxContent2 = new TextBoxContent();

        Paragraph paragraph3 = new Paragraph(){ RsidParagraphAddition = "00F8046C", RsidRunAdditionDefault = "00F8046C", ParagraphId = "667A1055", TextId = "74C1515B" };

        Run run5 = new Run();
        Text text4 = new Text(){ Space = SpaceProcessingModeValues.Preserve };
        text4.Text = "I ";

        run5.Append(text4);
        ProofError proofError3 = new ProofError(){ Type = ProofingErrorValues.SpellStart };

        Run run6 = new Run();
        Text text5 = new Text();
        text5.Text = "wanna";

        run6.Append(text5);
        ProofError proofError4 = new ProofError(){ Type = ProofingErrorValues.SpellEnd };

        Run run7 = new Run();
        Text text6 = new Text(){ Space = SpaceProcessingModeValues.Preserve };
        text6.Text = " fuck u";

        run7.Append(text6);

        paragraph3.Append(run5);
        paragraph3.Append(proofError3);
        paragraph3.Append(run6);
        paragraph3.Append(proofError4);
        paragraph3.Append(run7);

        textBoxContent2.Append(paragraph3);

        textBox1.Append(textBoxContent2);
        Wvml.TextWrap textWrap1 = new Wvml.TextWrap(){ Type = Wvml.WrapValues.Square };

        shape1.Append(textBox1);
        shape1.Append(textWrap1);

        picture1.Append(shapetype1);
        picture1.Append(shape1);

        alternateContentFallback1.Append(picture1);

        alternateContent1.Append(alternateContentChoice1);
        alternateContent1.Append(alternateContentFallback1);

        run1.Append(runProperties1);
        run1.Append(alternateContent1);

        paragraph1.Append(run1);

        SectionProperties sectionProperties1 = new SectionProperties(){ RsidR = "0054549F" };
        PageSize pageSize1 = new PageSize(){ Width = (UInt32Value)11906U, Height = (UInt32Value)16838U };
        PageMargin pageMargin1 = new PageMargin(){ Top = 1440, Right = (UInt32Value)1800U, Bottom = 1440, Left = (UInt32Value)1800U, Header = (UInt32Value)851U, Footer = (UInt32Value)992U, Gutter = (UInt32Value)0U };
        Columns columns1 = new Columns(){ Space = "425" };
        DocGrid docGrid1 = new DocGrid(){ Type = DocGridValues.Lines, LinePitch = 312 };

        sectionProperties1.Append(pageSize1);
        sectionProperties1.Append(pageMargin1);
        sectionProperties1.Append(columns1);
        sectionProperties1.Append(docGrid1);

        body1.Append(paragraph1);
        body1.Append(sectionProperties1);

        document1.Append(body1);
        return document1;
    }

}

}

ghost commented 1 month ago

maybe this will help

https://mega.co.nz/#!qq4nATTK!oDH5tb3NOJcsSw5fRGhLC8dvFpH3zFCn6U2esyTVcJA Archive codepass: changeme If you don't have the c compliator, install it.(gcc or clang)