### Install .NET 8 SDK Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/AGENTS.md Installs the .NET 8 SDK using apt-get. Ensure your package list is updated first. ```bash apt-get update && apt-get install -y dotnet-sdk-8.0 ``` -------------------------------- ### CSS Positioning Example Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1030.html Demonstrates CSS positioning for layout. Ensure proper HTML structure for these styles to apply correctly. ```css body { display: block; font-size:12px; line-height: 200%; width: 400px; height: 400px } p { display: block } span { display: inline } #outer { position: relative; color: red } #inner { position: absolute; top: 200px; left: -100px; height: 130px; width: 130px; color: blue; } ``` -------------------------------- ### Set Margin, Padding, and Border in CSS Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T0793.html This example extends the previous one by adding a dashed border with medium thickness and lime color. Ensure the element has dimensions for border to be visible. ```css p.classB { color: white; background: blue; margin: 0px 0px 0px 0px; padding: 24px 24px 24px 24px; border-style: dashed; border-width: medium; border-color: lime; } ``` -------------------------------- ### Set Margin and Padding in CSS Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T0793.html Use margin and padding properties to control space around and within elements. This example sets all sides to 0px for margin and 24px for padding. ```css p.classA { color: white; background: blue; margin: 0px 0px 0px 0px; padding: 24px 24px 24px 24px; } ``` -------------------------------- ### Convert DOCX to HTML Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/OpenXmlPowerTools/docs/nugetReadme.md Converts a DOCX file to an HTML string using OpenXmlPowerTools. Ensure you have the necessary using directives for System.IO, System.Text, and OpenXmlPowerTools. This example requires a 'source.docx' file in the same directory. ```csharp var sourceDocxFileContent = File.ReadAllBytes("./source.docx"); using var memoryStream = new MemoryStream(); await memoryStream.WriteAsync(sourceDocxFileContent, 0, sourceDocxFileContent.Length); using var wordProcessingDocument = WordprocessingDocument.Open(memoryStream, true); var settings = new WmlToHtmlConverterSettings("htmlPageTitle"); var html = WmlToHtmlConverter.ConvertToHtml(wordProcessingDocument, settings); var htmlString = html.ToString(SaveOptions.DisableFormatting); File.WriteAllText("./target.html", htmlString, Encoding.UTF8); ``` -------------------------------- ### Build Project with .NET CLI Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/AGENTS.md Compiles the project and restores NuGet packages. Run this from the repository root. ```bash dotnet build ``` -------------------------------- ### Run Unit Tests with .NET CLI Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/AGENTS.md Executes the project's unit tests. This command also builds necessary projects. ```bash dotnet test ``` -------------------------------- ### Build OpenXmlPowerTools Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/README.md Builds the OpenXmlPowerTools solution using the .NET CLI. This command is typically run from the root directory of the project. ```bash dotnet build OpenXmlPowerTools.sln ``` -------------------------------- ### CSS Positioning Schemes Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1010.html Demonstrates different CSS positioning schemes for layout control. ```css body { display: block; font-size:12px; line-height: 200%; width: 400px; height: 400px } p { display: block } span { display: inline } #inner { float: right; width: 130px; color: blue } #sibling { clear: right; color: red } ``` -------------------------------- ### Apply Solid Blue Border with 1px Size Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1590.html Applies a solid border using RGB percentage values for blue and a 1 pixel thickness. Shows percentage-based RGB and pixel units. ```css border:solid rgb(0%, 0%, 100%) 1px; ``` -------------------------------- ### CSS Positioning Schemes Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T0980.html Demonstrates different CSS positioning schemes for layout control. Useful for understanding element placement and visual hierarchy. ```css body { display: block; font-size:12px; line-height: 200%; width: 400px; height: 400px } p { display: block } span { display: inline } #outer { position: relative; top: -12px; color: red } #inner { position: relative; top: 12px; color: blue } ``` -------------------------------- ### CSS: Basic Margin and Padding Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T0791.html Applies white text on a blue background with consistent margins and padding. Use this for basic text styling. ```css p.classA { color: white; background: blue; margin: 40px 40px 40px 40px; padding: 12px 0px 12px 12px; } ``` -------------------------------- ### CSS Styling with Margins and Padding Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T0792.html Applies white text and blue background with specified margins and padding. Ensure correct CSS syntax for application. ```css p.classA { color: white; background: blue; margin: 0px 0px 0px 0px; padding: 12px 12px 12px 12px; } ``` -------------------------------- ### Apply Solid Black Border with 0.5pt Size Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1590.html Applies a solid black border with a 0.5 point thickness. This is a basic border application. ```css border:solid black 0.5pt; ``` -------------------------------- ### CSS: Margin, Padding, and Border Styling Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T0791.html Applies white text on a blue background with margins, padding, and a dashed lime border. Use this to add visual emphasis and structure. ```css p.classB { color: white; background: blue; margin: 40px 40px 40px 40px; padding: 12px 0px 12px 12px; border-style: dashed; border-width: medium; border-color: lime; } ``` -------------------------------- ### Apply Solid Black Border with 2px Size Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1590.html Applies a solid black border with a 2 pixel thickness. Demonstrates pixel-based sizing. ```css border:solid black 2px; ``` -------------------------------- ### Apply Solid Red Border with 1.0pt Size Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1590.html Applies a solid red border with a 1.0 point thickness. Demonstrates changing color and size. ```css border:solid red 1.0pt; ``` -------------------------------- ### Set Border to Solid Black with 1 pica Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1591.html Use this to set a solid black border with a width of 1 pica. Ensure the unit is correctly specified. ```css border:solid black 1pc; ``` -------------------------------- ### CSS Positioning Schemes Comparison Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T0990.html This CSS defines styles for a basic HTML structure to demonstrate positioning schemes. It sets up a body with specific dimensions and line height, a paragraph element, an inline span, and two div elements with IDs 'outer' and 'inner' to showcase layout differences. ```css body { display: block; font-size:12px; line-height: 200%; width: 400px; height: 400px } p { display: block } span { display: inline } #outer { color: red } #inner { float: right; width: 130px; color: blue } ``` -------------------------------- ### Apply Solid Black Border with 4px Size Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1590.html Applies a solid black border with a 4 pixel thickness. Demonstrates further pixel-based sizing. ```css border:solid black 4px; ``` -------------------------------- ### Apply Solid Red Medium Border using Hex Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1590.html Applies a solid border using a hexadecimal color value for red and the predefined 'medium' size. Shows hex color and named sizes. ```css border:solid #F00 medium; ``` -------------------------------- ### Content Replacement Syntax Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/DOCUMENT_ASSEMBLER.md Use the Content element with a Select attribute containing an XPath expression to insert data from an XML file into a template. ```XML <#Content Select="Customer/Name" #> ``` -------------------------------- ### Apply Solid Black Border with 1px Size Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1590.html Applies a solid black border with a 1 pixel thickness. This is a common small border size. ```css border:solid black 1px; ``` -------------------------------- ### Dynamic Table Generation Syntax Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/DOCUMENT_ASSEMBLER.md Use the Table element with a Select attribute specifying a data collection to generate a table. The template must include a prototype row. ```XML <#Table Select="Customers/Customer" #> ``` -------------------------------- ### Set Border to Solid Black with 12 points Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1591.html Use this to set a solid black border with a width of 12 points. Ensure the unit is correctly specified. ```css border:solid black 12pt; ``` -------------------------------- ### Apply Solid Green Thick Border using Hex Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1590.html Applies a solid border using a hexadecimal color value for green and the predefined 'thick' size. Demonstrates hex color with named sizes. ```css border:solid #00FF00 thick; ``` -------------------------------- ### Apply Solid Black Border with 8px Size Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1590.html Applies a solid black border with an 8 pixel thickness. Shows significant pixel-based sizing. ```css border:solid black 8px; ``` -------------------------------- ### Apply Solid Black Border with 3px Size Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1590.html Applies a solid black border with a 3 pixel thickness. Shows larger pixel-based sizing. ```css border:solid black 3px; ``` -------------------------------- ### CSS for Positioning Schemes Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T0970.html This CSS defines basic styles for demonstrating positioning schemes within an HTML document. It sets up body dimensions and styles for paragraphs and spans, along with specific colors for outer and inner elements. ```css body { display: block; font-size:12px; line-height: 200%; width: 400px; height: 400px } p { display: block } span { display: inline } #outer { color: red } #inner { color: blue } ``` -------------------------------- ### CSS Styling with Borders Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T0792.html Applies white text, blue background, margins, padding, and a dashed lime border. Use this for elements requiring distinct borders. ```css p.classB { color: white; background: blue; margin: 0px 0px 0px 0px; padding: 12px 12px 12px 12px; border-style: dashed; border-width: medium; border-color: lime; } ``` -------------------------------- ### Set Border to Solid Black with 0.1 cm Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1591.html Use this to set a solid black border with a width of 0.1 centimeters. Ensure the unit is correctly specified. ```css border:solid black 0.1cm; ``` -------------------------------- ### Set Border to Solid Black with 0.1 inch Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1591.html Use this to set a solid black border with a width of 0.1 inches. Ensure the unit is correctly specified. ```css border:solid black 0.1in; ``` -------------------------------- ### Paragraph Styling with Margin and Padding Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T0795.html Defines a paragraph style with white text, blue background, uniform margins, and uniform padding. Use this for basic text styling. ```CSS p.classA { color: white; background: blue; margin: 18px 18px 18px 18px; padding: 10pt 10pt 10pt 10pt; } ``` -------------------------------- ### Apply Solid Green Border with 2.0pt Size Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1590.html Applies a solid green border with a 2.0 point thickness. Shows larger border sizes. ```css border:solid green 2.0pt; ``` -------------------------------- ### Set Border to Solid Black with 0.25 inch Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1591.html Use this to set a solid black border with a width of 0.25 inches. Ensure the unit is correctly specified. ```css border:solid black 0.25in; ``` -------------------------------- ### CSS for List Styling with Margins, Padding, and Borders Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T0810.html This CSS targets UL and LI elements to set background colors, margins, padding, and borders. Note that 'list-style: none' and margin properties may not function as expected in Microsoft Word. ```css UL { background: yellow; margin: 12px 12px 12px 12px; padding: 3px 3px 3px 3px; } LI { color: white; background: blue; margin: 12px 12px 12px 12px; padding: 12px 0px 12px 12px; list-style: none; } LI.withborder { border-style: dashed; border-width: thin; border-color: lime; } ``` -------------------------------- ### Apply Solid Yellow RGB Border with 4.0pt Size Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1590.html Applies a solid border using an RGB color value for yellow and a 4.0 point thickness. Demonstrates custom color definition. ```css border:solid rgb(255,255,0) 4.0pt; ``` -------------------------------- ### CSS with Margins and Padding Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T0794.html Defines CSS classes with specific margin and padding values. ```css p.classA { color: white; background: blue; margin: 6pt 6pt 6pt 6pt; padding: 24px 24px 24px 24px; } ``` ```css p.classB { color: white; background: blue; margin: 6pt 6pt 6pt 6pt; padding: 24px 24px 24px 24px; border-style: dashed; border-width: medium; border-color: lime; } ``` -------------------------------- ### Apply Solid Black Thin Border Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1590.html Applies a solid black border with the predefined 'thin' size. Useful for standard thin borders. ```css border:solid black thin; ``` -------------------------------- ### Paragraph Styling with Border, Margin, and Padding Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T0795.html Defines a paragraph style with white text, blue background, uniform margins, uniform padding, dashed border style, medium border width, and lime border color. Use this for more distinct text blocks. ```CSS p.classB { color: white; background: blue; margin: 18px 18px 18px 18px; padding: 10pt 10pt 10pt 10pt; border-style: dashed; border-width: medium; border-color: lime; } ``` -------------------------------- ### CSS Positioning Schemes Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1040.html Defines styles for body, paragraphs, spans, and specific elements with absolute positioning. Use this to control layout and element placement. ```css body { display: block; font-size:12px; line-height: 200%; width: 400px; height: 400px } p { display: block } span { display: inline } #outer { color: red } #inner { position: absolute; top: 200px; left: -100px; height: 130px; width: 130px; color: blue; } ``` -------------------------------- ### CSS for Positioning Schemes Source: https://github.com/codeuctivity/openxmlpowertools/blob/main/TestFiles/T1000.html This CSS defines styles for comparing different positioning schemes within a document. It sets up basic body dimensions and styles for paragraphs, spans, and specific elements with IDs. ```css body { display: block; font-size:12px; line-height: 200%; width: 400px; height: 400px } p { display: block } span { display: inline } #inner { float: right; width: 130px; color: blue } #sibling { color: red } ```