當前位置: 首頁>>代碼示例>>Golang>>正文


Golang word.Document類代碼示例

本文整理匯總了Golang中github.com/mingqing/godocx/word.Document的典型用法代碼示例。如果您正苦於以下問題:Golang Document類的具體用法?Golang Document怎麽用?Golang Document使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Document類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Text7

func (d *DocXml) Text7(document *word.Document) {
	paragh := document.AddParagraph()
	ppr := paragh.AddProperties()
	ppr.AddAlign("center")
	rpr := ppr.AddRunProperties()
	rpr.Bold(true)
	font := rpr.AddFont()
	font.AsciiTheme = "majorEastAsia"
	font.EastAsiaTheme = "majorEastAsia"
	font.HansiTheme = "majorEastAsia"
	rpr.Fontsize("24")
	rpr.ComplexScriptFontsize("24")
	run := paragh.AddRunContent()
	rpr2 := run.AddRunProperties()
	rpr2.Bold(true)
	rpr2.Fontsize("24")
	rpr2.ComplexScriptFontsize("24")
	font2 := rpr2.AddFont()
	font2.AsciiTheme = "majorEastAsia"
	font2.EastAsiaTheme = "majorEastAsia"
	font2.HansiTheme = "majorEastAsia"
	font2.Hint = "eastAsia"
	run.Text("第I卷(選擇題)")

	d.defaultText(document, "")
}
開發者ID:mingqing,項目名稱:godocx,代碼行數:26,代碼來源:docxml.go

示例2: defaultText

func (d *DocXml) defaultText(document *word.Document, text string) {
	paragh := document.AddParagraph()
	run := paragh.AddRunContent()
	rpr := run.AddRunProperties()
	font := rpr.AddFont()
	font.Hint = "eastAsia"
	run.Text(text)
}
開發者ID:mingqing,項目名稱:godocx,代碼行數:8,代碼來源:docxml.go

示例3: Text4

func (d *DocXml) Text4(document *word.Document) {
	paragh := document.AddParagraph()
	ppr := paragh.AddProperties()
	ppr.AddAlign("center")
	run := paragh.AddRunContent()
	rpr2 := run.AddRunProperties()
	font2 := rpr2.AddFont()
	font2.Hint = "eastAsia"
	run.Text("考試範圍:xxx;考試時間:100分鍾;命題人:xxx")
}
開發者ID:mingqing,項目名稱:godocx,代碼行數:10,代碼來源:docxml.go

示例4: Text1

func (d *DocXml) Text1(document *word.Document) {
	paragh := document.AddParagraph()
	ppr := paragh.AddProperties()
	rpr := ppr.AddRunProperties()
	rpr.Bold(true)
	font := rpr.AddFont()
	font.EastAsia = "黑體"
	run := paragh.AddRunContent()
	rpr2 := run.AddRunProperties()
	rpr2.Bold(true)
	font2 := rpr2.AddFont()
	font2.Ascii = "黑體"
	font2.EastAsia = "黑體"
	font2.Hint = "eastAsia"
	run.Text("絕密★啟用前")
}
開發者ID:mingqing,項目名稱:godocx,代碼行數:16,代碼來源:docxml.go

示例5: Text2

func (d *DocXml) Text2(document *word.Document) {
	paragh := document.AddParagraph()
	ppr := paragh.AddProperties()
	ppr.AddAlign("center")
	rpr := ppr.AddRunProperties()
	rpr.Bold(true)
	font := rpr.AddFont()
	font.EastAsia = "黑體"
	rpr.Fontsize("30")
	rpr.ComplexScriptFontsize("30")
	run := paragh.AddRunContent()
	rpr2 := run.AddRunProperties()
	rpr2.Bold(true)
	rpr2.Fontsize("30")
	rpr2.ComplexScriptFontsize("30")
	font2 := rpr2.AddFont()
	font2.EastAsia = "黑體"
	font2.Hint = "eastAsia"
	run.Text("2015-2016學年度???學校11月月考卷")
}
開發者ID:mingqing,項目名稱:godocx,代碼行數:20,代碼來源:docxml.go

示例6: Text5

func (d *DocXml) Text5(document *word.Document) {
	tbl := document.AddTable()
	pr := tbl.AddProps()
	pr.AddStyle("a1")
	pr.AddWidth("0", "auto")
	pr.AddAlign("center")
	border := pr.AddBorders()
	temp := &word.Border{Val: "single", Sz: "4", Space: "0", Color: "000000", ThemeColor: "text1"}
	border.Top = temp
	border.Left = temp
	border.Bottom = temp
	border.Right = temp
	border.InsideH = temp
	border.InsideV = temp
	pr.AddLayout("fixed")
	pr.AddLook("04A0")
	grid := tbl.AddGrid()
	grid.AddWidth("1000")
	grid.AddWidth("1000")
	grid.AddWidth("1000")
	grid.AddWidth("1000")
	grid.AddWidth("1000")
	tr := tbl.AddRow()
	tr.AddProps().Align("center")

	d.Table1(tr, "題號")
	d.Table1(tr, "一")
	d.Table1(tr, "二")
	d.Table1(tr, "三")
	d.Table1(tr, "總分")

	tr2 := tbl.AddRow()
	tr2pr := tr2.AddProps()
	tr2pr.Align("center")
	tr2pr.Height("520")
	d.Table1(tr2, "得分")
	d.Table1(tr2, "")
	d.Table1(tr2, "")
	d.Table1(tr2, "")
	d.Table1(tr2, "")
}
開發者ID:mingqing,項目名稱:godocx,代碼行數:41,代碼來源:docxml.go

示例7: Text3

func (d *DocXml) Text3(document *word.Document) {
	paragh := document.AddParagraph()
	ppr := paragh.AddProperties()
	ppr.AddAlign("center")
	rpr := ppr.AddRunProperties()
	rpr.Bold(true)
	font := rpr.AddFont()
	font.EastAsia = "黑體"
	font.AsciiTheme = "minorHAnsi"
	font.HansiTheme = "minorHAnsi"
	rpr.Fontsize("36")
	rpr.ComplexScriptFontsize("36")
	run := paragh.AddRunContent()
	rpr2 := run.AddRunProperties()
	rpr2.Bold(true)
	rpr2.Fontsize("36")
	rpr2.ComplexScriptFontsize("36")
	font2 := rpr2.AddFont()
	font2.EastAsia = "黑體"
	font2.Hint = "eastAsia"
	run.Text("試卷副標題")
}
開發者ID:mingqing,項目名稱:godocx,代碼行數:22,代碼來源:docxml.go

示例8: Text8

func (d *DocXml) Text8(document *word.Document) {
	tbl := document.AddTable()
	pr := tbl.AddProps()
	pr.AddStyle("a7")
	pr.AddWidth("0", "auto")
	border := pr.AddBorders()
	temp := &word.Border{Val: "none", Sz: "0", Space: "0", Color: "auto"}
	border.Top = temp
	border.Left = temp
	border.Bottom = temp
	border.Right = temp
	border.InsideH = temp
	border.InsideV = temp
	pr.AddLook("04A0")
	grid := tbl.AddGrid()
	grid.AddWidth("2184")
	grid.AddWidth("3200")
	tr := tbl.AddRow()
	tc := tr.AddCell()
	tcpr := tc.AddProps()
	tcpr.Width("0", "auto")

	tbl2 := word.NewTable()
	pr2 := tbl2.AddProps()
	pr2.AddStyle("a7")
	pr2.AddWidth("1938", "dxa")
	border2 := pr2.AddBorders()
	temp2 := &word.Border{Val: "signle", Sz: "12", Space: "0", Color: "auto"}
	border2.Top = temp2
	border2.Left = temp2
	border2.Bottom = temp2
	border2.Right = temp2
	border2.InsideH = temp2
	border2.InsideV = temp2
	pr2.AddLook("04A0")
	grid2 := tbl2.AddGrid()
	grid2.AddWidth("969")
	grid2.AddWidth("969")
	tr2 := tbl2.AddRow()
	tr2pr := tr2.AddProps()
	tr2pr.Height("274")
	d.Table2(tr2, "評卷人")
	d.Table2(tr2, "得分")
	tr3 := tbl2.AddRow()
	tr3pr := tr3.AddProps()
	tr3pr.Height("549")
	d.Table2(tr3, "")
	d.Table2(tr3, "")

	tc.Content = make([]interface{}, 0)
	tc.Content = append(tc.Content, tbl2)
	p := &word.Paragraph{}
	tc.Content = append(tc.Content, p)

	tc2 := tr.AddCell()
	tcpr2 := tc2.AddProps()
	tcpr2.Width("0", "auto")
	tcpr2.Align("center")
	tcP := tc2.AddParagraph()
	tcPPr := tcP.AddProperties()
	//tcPPr.AddAlign("center")
	tcPPr.AddRunProperties().Bold(true)
	tcPrc := tcP.AddRunContent()
	rcpr := tcPrc.AddRunProperties()
	font := rcpr.AddFont()
	font.Hint = "eastAsia"
	rcpr.Bold(true)
	tcPrc.Text("一、選擇題(題型注釋)")
}
開發者ID:mingqing,項目名稱:godocx,代碼行數:69,代碼來源:docxml.go


注:本文中的github.com/mingqing/godocx/word.Document類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。