本文整理汇总了C#中Run.Append方法的典型用法代码示例。如果您正苦于以下问题:C# Run.Append方法的具体用法?C# Run.Append怎么用?C# Run.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Run
的用法示例。
在下文中一共展示了Run.Append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFormattedElement
public static OpenXmlElement GetFormattedElement(Model.Text text)
{
Text docText = new Text(text.TextContent);
Run run = new Run();
RunProperties runProp = CreateRun(text);
if (runProp != null) run.Append(runProp);
run.Append(docText);
return run;
}
示例2: CreateCodeParagraph
private Paragraph CreateCodeParagraph(CodeVM code)
{
Paragraph paragraph1 = new Paragraph();
ParagraphProperties paragraphProperties1 = new ParagraphProperties();
Indentation indentation1 = new Indentation(){ FirstLine = "210", FirstLineChars = 100 };
paragraphProperties1.Append(indentation1);
Run run1 = new Run();
RunProperties runProperties1 = new RunProperties();
RunFonts runFonts1 = new RunFonts(){ Hint = FontTypeHintValues.EastAsia };
runProperties1.Append(runFonts1);
Text text1 = new Text();
text1.Text = code.Value;
run1.Append(runProperties1);
run1.Append(text1);
Run run2 = new Run();
RunProperties runProperties2 = new RunProperties();
RunFonts runFonts2 = new RunFonts(){ Hint = FontTypeHintValues.EastAsia };
runProperties2.Append(runFonts2);
TabChar tabChar1 = new TabChar();
run2.Append(runProperties2);
run2.Append(tabChar1);
Run run3 = new Run();
RunProperties runProperties3 = new RunProperties();
RunFonts runFonts3 = new RunFonts(){ Hint = FontTypeHintValues.EastAsia };
runProperties3.Append(runFonts3);
Text text2 = new Text();
text2.Text = code.Label;
run3.Append(runProperties3);
run3.Append(text2);
paragraph1.Append(paragraphProperties1);
paragraph1.Append(run1);
paragraph1.Append(run2);
paragraph1.Append(run3);
return paragraph1;
}
示例3: ApplyFooter
private void ApplyFooter(FooterPart footerPart)
{
var footer1 = new Footer();
footer1.AddNamespaceDeclaration("ve", "http://schemas.openxmlformats.org/markup-compatibility/2006");
footer1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
footer1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
footer1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
footer1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
footer1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
footer1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
footer1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
footer1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
var paragraph1 = new Paragraph { RsidParagraphAddition = "005641D2", RsidRunAdditionDefault = "005641D2" };
var paragraphProperties1 = new ParagraphProperties();
var paragraphStyleId1 = new ParagraphStyleId { Val = "Footer" };
paragraphProperties1.Append(paragraphStyleId1);
var run1 = new Run();
var text1 = new Text();
text1.Text = "Generated with Pickles " + Assembly.GetExecutingAssembly().GetName().Version;
run1.Append(text1);
paragraph1.Append(paragraphProperties1);
paragraph1.Append(run1);
footer1.Append(paragraph1);
footerPart.Footer = footer1;
}
示例4: GenerateParagraph
public static void GenerateParagraph(this Body body, string text, string styleId)
{
var paragraph = new Paragraph
{
RsidParagraphAddition = "00CC1B7A",
RsidParagraphProperties = "0016335E",
RsidRunAdditionDefault = "0016335E"
};
var paragraphProperties = new ParagraphProperties();
var paragraphStyleId = new ParagraphStyleId {Val = styleId};
paragraphProperties.Append(paragraphStyleId);
var run1 = new Run();
var text1 = new Text();
text1.Text = text;
run1.Append(text1);
paragraph.Append(paragraphProperties);
paragraph.Append(run1);
body.Append(paragraph);
}
示例5: GenerateReportBug
public static string GenerateReportBug(DBO.BugReport bugReport)
{
string docName = System.Web.HttpContext.Current.Server.MapPath("~/download/")+"test.docx";
using (WordprocessingDocument package = WordprocessingDocument.Create( docName, WordprocessingDocumentType.Document))
{
Run run = new Run();
//besoin de le faire si c'est une creation
package.AddMainDocumentPart();
foreach (string str in bugReport.Comment)
{
run.Append(new Text(str), new Break());
}
// Création du document.
package.MainDocumentPart.Document =
new Document(
new Body(
new Paragraph(
new Run(
new Text("Rapport de bug"))),
new Run(
new Text ("Titre :" + bugReport.Title),
new Break(),
new Text ("Personnable responble :" + bugReport.Responsable),
new Break(),
new Text ("Statut :" + bugReport.Statut),
new Break (),
new Text ("commentaire:")
),run));
// Enregistrer le contenu dans le document
package.MainDocumentPart.Document.Save();
return docName;
}
}
示例6: GetListItem
/// <summary>
/// Returns a OpenXMl paragraph representing formatted listItem.
/// </summary>
/// <param name="item">listItem object</param>
/// <param name="numStyleId">style id to use</param>
/// <returns></returns>
private static Paragraph GetListItem(Model.ListItem item, int numStyleId)
{
Paragraph listItemPara = new Paragraph();
ParagraphProperties paraProps = new ParagraphProperties();
NumberingProperties numberingProps = new NumberingProperties();
NumberingLevelReference numberingLevelReference = new NumberingLevelReference() { Val = 0 };
NumberingId numberingId = new NumberingId() { Val = numStyleId };
numberingProps.Append(numberingLevelReference);
numberingProps.Append(numberingId);
paraProps.Append(numberingProps);
Run listRun = new Run();
Text listItemText = new Text()
{
Text = item.Body
};
listRun.Append(listItemText);
listItemPara.Append(paraProps);
listItemPara.Append(listRun);
return listItemPara;
}
示例7: AddAlphaRow
public Paragraph AddAlphaRow()
{
var paragraph1 = new Paragraph {RsidParagraphMarkRevision = "005205ED", RsidParagraphAddition = "00A01149", RsidParagraphProperties = "005205ED", RsidRunAdditionDefault = "00E7001C"};
var paragraphProperties1 = new ParagraphProperties();
var spacingBetweenLines1 = new SpacingBetweenLines {After = "60", Line = "240", LineRule = LineSpacingRuleValues.Auto};
var justification1 = new Justification {Val = JustificationValues.Center};
var paragraphMarkRunProperties1 = new ParagraphMarkRunProperties();
var runFonts1 = new RunFonts {ComplexScriptTheme = ThemeFontValues.MinorHighAnsi};
var bold1 = new Bold();
var fontSize1 = new FontSize {Val = "32"};
var fontSizeComplexScript1 = new FontSizeComplexScript {Val = "32"};
paragraphMarkRunProperties1.Append(runFonts1);
paragraphMarkRunProperties1.Append(bold1);
paragraphMarkRunProperties1.Append(fontSize1);
paragraphMarkRunProperties1.Append(fontSizeComplexScript1);
paragraphProperties1.Append(new KeepNext());
paragraphProperties1.Append(spacingBetweenLines1);
paragraphProperties1.Append(justification1);
paragraphProperties1.Append(paragraphMarkRunProperties1);
var run1 = new Run {RsidRunProperties = "005205ED"};
var runProperties1 = new RunProperties();
var runFonts2 = new RunFonts {ComplexScriptTheme = ThemeFontValues.MinorHighAnsi};
var bold2 = new Bold();
var fontSize2 = new FontSize {Val = "32"};
var fontSizeComplexScript2 = new FontSizeComplexScript {Val = "32"};
runProperties1.Append(runFonts2);
runProperties1.Append(bold2);
runProperties1.Append(fontSize2);
runProperties1.Append(fontSizeComplexScript2);
var text1 = new Text();
text1.Text = FamilyName.Substring(0, 1);
run1.Append(runProperties1);
run1.Append(text1);
paragraph1.Append(paragraphProperties1);
paragraph1.Append(run1);
return paragraph1;
}
示例8: GenerateHeaderPartContent
private static void GenerateHeaderPartContent(HeaderPart part)
{
Header header1 = new Header() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 wp14" } };
header1.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
header1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
header1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
header1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
header1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
header1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
header1.AddNamespaceDeclaration("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
header1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
header1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
header1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
header1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
header1.AddNamespaceDeclaration("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
header1.AddNamespaceDeclaration("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
header1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
header1.AddNamespaceDeclaration("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");
Paragraph paragraph1 = new Paragraph() { RsidParagraphAddition = "00164C17", RsidRunAdditionDefault = "00164C17" };
ParagraphProperties paragraphProperties1 = new ParagraphProperties();
ParagraphStyleId paragraphStyleId1 = new ParagraphStyleId() { Val = "Header" };
paragraphProperties1.Append(paragraphStyleId1);
Run run1 = new Run();
DocumentFormat.OpenXml.Wordprocessing.Text text1 = new DocumentFormat.OpenXml.Wordprocessing.Text();
text1.Text = "Header";
run1.Append(text1);
paragraph1.Append(paragraphProperties1);
paragraph1.Append(run1);
header1.Append(paragraph1);
part.Header = header1;
}
示例9: AddSignatureFooter
//static void Main(string[] args)
//{
// //CreateWordDoc("C:/Users/Trevor/Documents/test.docx", "This is Text, ya ya ya.");
// // AddSignatureFooter("C:/Users/Trevor/Documents/test.docx", "-by Nelson Mandela");
// //Test statistics
// Console.Write(BasicStats("C:/Users/Trevor/Documents/testGAO.docx"));
// Console.ReadLine();
//}
//Add footer with string signature to existing document
public static void AddSignatureFooter(string filepath, string signature)
{
using (WordprocessingDocument doc = WordprocessingDocument.Open(filepath, true))
{
MainDocumentPart mainDocPart = doc.MainDocumentPart;
if (mainDocPart.Document == null)
{
mainDocPart.Document = new Document();
}
mainDocPart.DeleteParts(mainDocPart.FooterParts);
FooterPart footerPart1 = mainDocPart.AddNewPart<FooterPart>("r98");
Footer footer1 = new Footer();
Paragraph paragraph1 = new Paragraph();
Run run1 = new Run();
Text text1 = new Text { Text = signature };
run1.Append(text1);
paragraph1.Append(run1);
footer1.Append(paragraph1);
footerPart1.Footer = footer1;
SectionProperties sectionProperties1 = mainDocPart.Document.Body.Descendants<SectionProperties>().FirstOrDefault();
if (sectionProperties1 == null)
{
sectionProperties1 = new SectionProperties();
mainDocPart.Document.Body.Append(sectionProperties1);
}
FooterReference footerReference1 = new FooterReference { Type = HeaderFooterValues.Default, Id = "r98" };
sectionProperties1.InsertAt(footerReference1, 0);
}
}
示例10: GenerateTable
// Creates an Table instance and adds its children.
public static Table GenerateTable(Document doc, System.Data.DataTable datetable)
{
Table table = new Table();
//
PageSize pagesize = doc.Body.Descendants<PageSize>().First();
PageMargin pagemargin = doc.Body.Descendants<PageMargin>().First();
//
var AvailableSumWidth = (int)(pagesize.Width - pagemargin.Right - pagemargin.Left);
TableBorders tborder = new Func<TableBorders>(delegate()
{
TableBorders tableBorders1 = new TableBorders();
TopBorder topBorder1 = new TopBorder() { Val = BorderValues.Single, Color = "auto", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
LeftBorder leftBorder1 = new LeftBorder() { Val = BorderValues.Single, Color = "auto", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
BottomBorder bottomBorder1 = new BottomBorder() { Val = BorderValues.Single, Color = "auto", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
RightBorder rightBorder1 = new RightBorder() { Val = BorderValues.Single, Color = "auto", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
InsideHorizontalBorder insideHorizontalBorder1 = new InsideHorizontalBorder() { Val = BorderValues.Single, Color = "auto", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
InsideVerticalBorder insideVerticalBorder1 = new InsideVerticalBorder() { Val = BorderValues.Single, Color = "auto", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
tableBorders1.Append(topBorder1);
tableBorders1.Append(leftBorder1);
tableBorders1.Append(bottomBorder1);
tableBorders1.Append(rightBorder1);
tableBorders1.Append(insideHorizontalBorder1);
tableBorders1.Append(insideVerticalBorder1);
return tableBorders1;
})();
table.AppendChild<TableProperties>(new TableProperties(
new TableStyle() { Val = "a7" },
tborder,
new TableWidth() { Width = "0", Type = TableWidthUnitValues.Auto },
new TableLook() { Val = "04A0", FirstRow = true, LastRow = false, FirstColumn = true, LastColumn = false, NoHorizontalBand = false, NoVerticalBand = true }
));
int sumColumn = datetable.Columns.Count;
int averwidth = AvailableSumWidth / sumColumn;
Double set_colSumW = 0;
int remainSumW = 0;
foreach (System.Data.DataColumn item in datetable.Columns)
{
Object col_w = item.ExtendedProperties["width"];
if (col_w != null) { set_colSumW += Convert.ToDouble(col_w); remainSumW += averwidth; }
}
foreach (System.Data.DataColumn item in datetable.Columns)
{
Object col_w = item.ExtendedProperties["width"];
if (col_w != null) item.ExtendedProperties.Add("WordWidth", Math.Floor((remainSumW * Convert.ToDouble(col_w) / set_colSumW)));
else item.ExtendedProperties.Add("WordWidth", averwidth);
}
for (int i = 0; i < sumColumn; i++)
{
int col_w = Convert.ToInt32(datetable.Columns[i].ExtendedProperties["WordWidth"]);
table.AppendChild<GridColumn>(new GridColumn() { Width = col_w.ToString() });
}
List<System.Data.DataRow> lstCol = new List<System.Data.DataRow>();
System.Data.DataRow dr = datetable.NewRow();
List<object> lstObj = new List<object>();
foreach (System.Data.DataColumn item in datetable.Columns)
{
lstObj.Add(item.ColumnName);
}
dr.ItemArray = lstObj.ToArray();
datetable.Rows.InsertAt(dr, 0);
foreach (System.Data.DataRow item in datetable.Rows)
{
TableRow tableRow = new TableRow() { RsidTableRowAddition = "00D24D12", RsidTableRowProperties = "00D24D12" };
for (int i = 0; i < sumColumn; i++)
{
int col_w = Convert.ToInt32(datetable.Columns[i].ExtendedProperties["WordWidth"]);
string cellValue = item[i].ToString();
TableCell tableCell1 = new TableCell();
TableCellProperties tableCellProperties1 = new TableCellProperties();
TableCellWidth tableCellWidth1 = new TableCellWidth() { Width = col_w.ToString(), Type = TableWidthUnitValues.Dxa };
tableCellProperties1.Append(tableCellWidth1);
Paragraph paragraph1 = new Paragraph() { RsidParagraphAddition = "00D24D12", RsidParagraphProperties = "003246FB", RsidRunAdditionDefault = "00D24D12" };
Run run1 = new Run();
RunProperties runProperties1 = new RunProperties();
RunFonts runFonts1 = new RunFonts() { Hint = FontTypeHintValues.EastAsia };
runProperties1.Append(runFonts1);
Text text1 = new Text();
text1.Text = cellValue;
run1.Append(runProperties1);
run1.Append(text1);
//.........这里部分代码省略.........
示例11: BuildCell
private TableCell BuildCell(string text, int gridSpan = 1, VerticalMerge vm = null, bool bold = false)
{
TableCell cell = new TableCell();
Paragraph p = new Paragraph();
ParagraphProperties paragraphProperties = new ParagraphProperties();
Justification justification = new Justification() { Val = JustificationValues.Center };
paragraphProperties.Append(justification);
if (bold)
{
ParagraphMarkRunProperties paragraphMarkRunProperties = new ParagraphMarkRunProperties();
Bold boldStyle = new Bold();
paragraphMarkRunProperties.Append(boldStyle);
paragraphProperties.Append(paragraphMarkRunProperties);
}
p.Append(paragraphProperties);
if (!string.IsNullOrEmpty(text))
{
Run r = new Run();
RunProperties runProperties = new RunProperties();
if (bold)
{
Bold boldStyle = new Bold();
runProperties.Append(boldStyle);
}
r.Append(runProperties);
Text t = new Text { Text = text };
r.AppendChild<Text>(t);
p.AppendChild<Run>(r);
}
TableCellProperties cellProperty = new TableCellProperties();
TableCellVerticalAlignment tableCellVerticalAlignment1 = new TableCellVerticalAlignment() { Val = TableVerticalAlignmentValues.Center };
cellProperty.Append(tableCellVerticalAlignment1);
if (gridSpan > 1)
{
GridSpan gs = new GridSpan { Val = gridSpan };
cellProperty.Append(gs);
}
if (vm != null)
{
cellProperty.Append(vm);
}
cell.Append(cellProperty);
cell.Append(p);
return cell;
}
示例12: GenerateMainDocumentPart1Content
// Generates content of mainDocumentPart1.
private void GenerateMainDocumentPart1Content(MainDocumentPart mainDocumentPart1)
{
Document document1 = new Document(){ MCAttributes = new MarkupCompatibilityAttributes(){ Ignorable = "w14 w15 wp14" } };
document1.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
document1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
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/2010/11/wordml");
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();
SdtBlock sdtBlock1 = new SdtBlock();
SdtProperties sdtProperties1 = new SdtProperties();
RunProperties runProperties1 = new RunProperties();
RunFonts runFonts1 = new RunFonts(){ Hint = FontTypeHintValues.EastAsia };
runProperties1.Append(runFonts1);
SdtAlias sdtAlias1 = new SdtAlias(){ Val = "Test1.1.1" };
Tag tag1 = new Tag(){ Val = "Test1.1.1" };
SdtId sdtId1 = new SdtId(){ Val = -1832063964 };
SdtPlaceholder sdtPlaceholder1 = new SdtPlaceholder();
DocPartReference docPartReference1 = new DocPartReference(){ Val = "DefaultPlaceholder_1081868558" };
sdtPlaceholder1.Append(docPartReference1);
ShowingPlaceholder showingPlaceholder1 = new ShowingPlaceholder();
SdtContentText sdtContentText1 = new SdtContentText();
sdtProperties1.Append(runProperties1);
sdtProperties1.Append(sdtAlias1);
sdtProperties1.Append(tag1);
sdtProperties1.Append(sdtId1);
sdtProperties1.Append(sdtPlaceholder1);
sdtProperties1.Append(showingPlaceholder1);
sdtProperties1.Append(sdtContentText1);
SdtEndCharProperties sdtEndCharProperties1 = new SdtEndCharProperties();
SdtContentBlock sdtContentBlock1 = new SdtContentBlock();
Paragraph paragraph1 = new Paragraph(){ RsidParagraphAddition = "00535C5E", RsidRunAdditionDefault = "000010BA" };
Run run1 = new Run(){ RsidRunProperties = "003E0DED" };
RunProperties runProperties2 = new RunProperties();
RunStyle runStyle1 = new RunStyle(){ Val = "PlaceholderText" };
runProperties2.Append(runStyle1);
Text text1 = new Text();
text1.Text = "Click here to enter text.";
run1.Append(runProperties2);
run1.Append(text1);
paragraph1.Append(run1);
sdtContentBlock1.Append(paragraph1);
sdtBlock1.Append(sdtProperties1);
sdtBlock1.Append(sdtEndCharProperties1);
sdtBlock1.Append(sdtContentBlock1);
SdtBlock sdtBlock2 = new SdtBlock();
SdtProperties sdtProperties2 = new SdtProperties();
RunProperties runProperties3 = new RunProperties();
RunFonts runFonts2 = new RunFonts(){ Hint = FontTypeHintValues.EastAsia };
runProperties3.Append(runFonts2);
SdtAlias sdtAlias2 = new SdtAlias(){ Val = "Test1.1.2" };
Tag tag2 = new Tag(){ Val = "Test1.1.2" };
SdtId sdtId2 = new SdtId(){ Val = -2043657734 };
SdtPlaceholder sdtPlaceholder2 = new SdtPlaceholder();
DocPartReference docPartReference2 = new DocPartReference(){ Val = "DefaultPlaceholder_1081868558" };
sdtPlaceholder2.Append(docPartReference2);
SdtContentText sdtContentText2 = new SdtContentText();
sdtProperties2.Append(runProperties3);
sdtProperties2.Append(sdtAlias2);
sdtProperties2.Append(tag2);
sdtProperties2.Append(sdtId2);
sdtProperties2.Append(sdtPlaceholder2);
sdtProperties2.Append(sdtContentText2);
SdtEndCharProperties sdtEndCharProperties2 = new SdtEndCharProperties();
//.........这里部分代码省略.........
示例13: GenerateLastParagraph
public Paragraph GenerateLastParagraph()
{
Paragraph paragraph1 = new Paragraph() { RsidParagraphAddition = "00000000", RsidParagraphProperties = "008A3B59", RsidRunAdditionDefault = "008A3B59" };
ParagraphProperties paragraphProperties1 = new ParagraphProperties();
Justification justification1 = new Justification() { Val = JustificationValues.Left };
Run run1 = new Run();
RunProperties runProperties1 = new RunProperties();
RunFonts runFonts1 = new RunFonts() { Hint = FontTypeHintValues.EastAsia };
runProperties1.Append(runFonts1);
Text text1 = new Text();
text1.Text = "敬告:1、管材检测执行标准:API SPEC 5CT、四川石油管理局发布Q/CY097-1998《钻井技术操作流程》、《套管油管检验规范》相关标准和内容。" + "2、《报告书》表格列出为质量检验合格管。" + "3、管材出库后的运输、不规范装卸,井场作业过程中发生的损伤,不属于质量承诺范围。" + "4、请固井工程师按实际入井管串顺序记录\"单根编号\"所在井下位置,便于管材质量跟踪管理、查询。";
run1.Append(runProperties1);
run1.Append(text1);
paragraph1.Append(paragraphProperties1);
paragraph1.Append(run1);
return paragraph1;
}
示例14: UpdateElements
private void UpdateElements(OpenXmlElement root, List<OpenXmlElement> elements, IEnumerable<ProjectFile> projectFiles, Customer customer, User user)
{
foreach (var projectFile in projectFiles)
{
UpdateSingleFile(root, elements, new List<TokensProvider>() {customer, user, projectFile});
#region empty lines
var emptyLineParagraph = new Paragraph() { RsidParagraphAddition = "0077013B", RsidRunAdditionDefault = "00684C81", ParagraphId = "5E06053C", TextId = "77777777" };
var emptyLineRun = new Run();
var emptyLineText = new Text() { Text = String.Empty };
emptyLineRun.Append(emptyLineText);
emptyLineParagraph.Append(emptyLineRun);
root.Append(emptyLineParagraph);
root.Append((OpenXmlElement)emptyLineParagraph.Clone());
#endregion
}
}
示例15: GetTable
private TableRow GetTable(bool blankLine, Paragraph para = null)
{
if (blankLine)
{
paragraph = new Paragraph();
ParagraphProperties paraProperties = new ParagraphProperties();
paraProperties.Append(new Justification() { Val = JustificationValues.Left });
paraProperties.Append(new SpacingBetweenLines() { After = "10", Line = "240", LineRule = LineSpacingRuleValues.Auto });
paragraph.Append(paraProperties);
body.Append(paragraph);
Run run = new Run();
RunProperties runProperties = new RunProperties();
runProperties.Append(new RunFonts() { Ascii = "Cambria" });
runProperties.Append(new FontSize() { Val = "3" });
run.Append(runProperties);
run.Append(new Text(".") { Space = SpaceProcessingModeValues.Preserve });
paragraph.Append(run);
}
Table tbl = new Table();
TableProperties tableProperties = new TableProperties();
if(para != null) // this is used only for drawing the H
tableProperties.Append(new TableWidth() { Type = TableWidthUnitValues.Auto, Width = "0" });
else
tableProperties.Append(new TableWidth() { Type = TableWidthUnitValues.Pct, Width = "5000" });
tableProperties.Append(new TableBorders(){
TopBorder = new TopBorder() { Val = BorderValues.None },
BottomBorder = new BottomBorder() { Val = BorderValues.None },
LeftBorder = new LeftBorder() { Val = BorderValues.None },
RightBorder = new RightBorder() { Val = BorderValues.None }
});
tableProperties.Append(new AutofitToFirstFixedWidthCell());
tbl.Append(tableProperties);
if (para != null)
para.Append(tbl);
else
body.Append(tbl);
TableRow trLetter = new TableRow();
tbl.Append(trLetter);
return trLetter;
}