当前位置: 首页 > news >正文

免费建站系统怎么用友情链接例子

免费建站系统怎么用,友情链接例子,聚美优品网站建设产品策略,免费咨询男性问题毫无疑问GO的生态就是一坨大便。老子英文水平小学啊。 实现简单文本格式 文本字体颜色、大小、突出显示等。 创建要给docx文件容器【我估算的】 doc : document.New() defer doc.Close() doc.SaveToFile("simple.docx") 把容器保存为文件 设置标题 创建自然段…

毫无疑问GO的生态就是一坨大便。老子英文水平小学啊。

实现简单文本格式 文本字体颜色、大小、突出显示等。

创建要给docx文件容器【我估算的】

doc := document.New()
defer doc.Close()

doc.SaveToFile("simple.docx")  把容器保存为文件

设置标题

创建自然段Paragraph

run设置文本内容

para := doc.AddParagraph()
run := para.AddRun()
para.SetStyle("Title")
run.AddText("Simple Document Formatting")

效果图

设置缩进

para = doc.AddParagraph()
para.Properties().SetFirstLineIndent(0.5 * measurement.Inch)run = para.AddRun()
run.AddText("A run is a string of characters with the same formatting. ")

设置粗体、字体、大小、颜色

run = para.AddRun()
run.Properties().SetBold(true)
run.Properties().SetFontFamily("Courier")
run.Properties().SetSize(15)
run.Properties().SetColor(color.Red)
run.AddText("Multiple runs with different formatting can exist in the same paragraph. ")

换行

run.AddBreak()

run = para.AddRun()
run.AddText("Adding breaks to a run will insert line breaks after the run. ")
run.AddBreak()
run.AddBreak()

输入文本

run = createParaRun(doc, "Runs support styling options:")

大写

run = createParaRun(doc, "small caps")run.Properties().SetSmallCaps(true)

画线和画两条

	run = createParaRun(doc, "strike")run.Properties().SetStrikeThrough(true)run = createParaRun(doc, "double strike")run.Properties().SetDoubleStrikeThrough(true)

其他

run = createParaRun(doc, "outline")run.Properties().SetOutline(true)run = createParaRun(doc, "emboss")run.Properties().SetEmboss(true)run = createParaRun(doc, "shadow")run.Properties().SetShadow(true)run = createParaRun(doc, "imprint")run.Properties().SetImprint(true)run = createParaRun(doc, "highlighting")run.Properties().SetHighlight(wml.ST_HighlightColorYellow)run = createParaRun(doc, "underline")run.Properties().SetUnderline(wml.ST_UnderlineWavyDouble, color.Red)run = createParaRun(doc, "text effects")run.Properties().SetEffect(wml.ST_TextEffectAntsRed)//选择编号样式?
nd := doc.Numbering.Definitions()[0]for i := 1; i < 5; i++ {p := doc.AddParagraph()
//设置编号等级?p.SetNumberingLevel(i - 1)
//设置编号样式p.SetNumberingDefinition(nd)run := p.AddRun()run.AddText(fmt.Sprintf("Level %d", i))}

完整DEMO代码

// Copyright 2017 FoxyUtils ehf. All rights reserved.
package main
//导包
import ( "fmt""os""github.com/unidoc/unioffice/color""github.com/unidoc/unioffice/common/license""github.com/unidoc/unioffice/document""github.com/unidoc/unioffice/measurement""github.com/unidoc/unioffice/schema/soo/wml"
)
//资本家的密钥
func init() {// Make sure to load your metered License API key prior to using the library.// If you need a key, you can sign up and create a free one at https://cloud.unidoc.ioerr := license.SetMeteredKey(os.Getenv(`UNIDOC_LICENSE_API_KEY`))if err != nil {panic(err)}
}func main() {//创建docdoc := document.New()
//关闭docdefer doc.Close()para := doc.AddParagraph()run := para.AddRun()para.SetStyle("Title")run.AddText("Simple Document Formatting")para = doc.AddParagraph()para.SetStyle("Heading1")run = para.AddRun()run.AddText("Some Heading Text")para = doc.AddParagraph()para.SetStyle("Heading2")run = para.AddRun()run.AddText("Some Heading Text")para = doc.AddParagraph()para.SetStyle("Heading3")run = para.AddRun()run.AddText("Some Heading Text")para = doc.AddParagraph()para.Properties().SetFirstLineIndent(0.5 * measurement.Inch)run = para.AddRun()run.AddText("A run is a string of characters with the same formatting. ")run = para.AddRun()run.Properties().SetBold(true)run.Properties().SetFontFamily("Courier")run.Properties().SetSize(15)run.Properties().SetColor(color.Red)run.AddText("Multiple runs with different formatting can exist in the same paragraph. ")run = para.AddRun()run.AddText("Adding breaks to a run will insert line breaks after the run. ")run.AddBreak()run.AddBreak()run = createParaRun(doc, "Runs support styling options:")run = createParaRun(doc, "small caps")run.Properties().SetSmallCaps(true)run = createParaRun(doc, "strike")run.Properties().SetStrikeThrough(true)run = createParaRun(doc, "double strike")run.Properties().SetDoubleStrikeThrough(true)run = createParaRun(doc, "outline")run.Properties().SetOutline(true)run = createParaRun(doc, "emboss")run.Properties().SetEmboss(true)run = createParaRun(doc, "shadow")run.Properties().SetShadow(true)run = createParaRun(doc, "imprint")run.Properties().SetImprint(true)run = createParaRun(doc, "highlighting")run.Properties().SetHighlight(wml.ST_HighlightColorYellow)run = createParaRun(doc, "underline")run.Properties().SetUnderline(wml.ST_UnderlineWavyDouble, color.Red)run = createParaRun(doc, "text effects")run.Properties().SetEffect(wml.ST_TextEffectAntsRed)nd := doc.Numbering.Definitions()[0]for i := 1; i < 5; i++ {p := doc.AddParagraph()p.SetNumberingLevel(i - 1)p.SetNumberingDefinition(nd)run := p.AddRun()run.AddText(fmt.Sprintf("Level %d", i))}doc.SaveToFile("simple.docx")
}func createParaRun(doc *document.Document, s string) document.Run {para := doc.AddParagraph()run := para.AddRun()run.AddText(s)return run
}

http://www.laogonggong.com/news/39717.html

相关文章:

  • 高级营销网站建设只需1200元会计培训班要多少钱一般要学多久
  • 网站平台建设技术报告网络营销渠道策略研究
  • 哪里有建网站的长沙网站公司品牌
  • 郑州网站建设 论坛杭州百度推广代理公司哪家好
  • 网站信息服务费怎么做凭证短视频赚钱app软件
  • 不同网站模块分析网络培训系统
  • 大型商城网站建设方案高质量外链
  • 外贸网络营销的主动营销有哪些宁波seo企业推广
  • 西安网易网站建设互动营销是什么
  • 哪些网站做任务可以赚钱seo工资水平
  • 网站托管服务协议中国新闻网发稿
  • 地产网站互动营销店铺引流的30种方法
  • 企业信息查询免费软件自己的网站怎么做seo
  • 网站建设技术解决方案网络营销的概述
  • 外贸网站建设要注意什么360搜图片识图
  • 个人网站免费模板自媒体怎么做
  • 网站的目的广州最新发布最新
  • 微信注册网站入口海外游戏推广平台
  • 电商网站开发计划市场推广策略 包括哪些
  • 中国建设资格注册中心网站账号权重查询入口
  • 做asp网站教程今日疫情实时数据
  • 重庆联通的网站建设免费观看b站的广告网站平台
  • 福建省住房和城乡建设厅网站电话灰色seo关键词排名
  • 普陀区网站建设前端宁波seo关键词排名优化
  • 网站空间不支持php5.4社群营销活动策划方案
  • 厦门 网站开发河南网站优化公司
  • 网站被电脑管家拦截做301跳转手机网页制作软件
  • 恶意点击别人的网站自媒体135免费版下载
  • 商务厅网站建设意见整合营销的最高阶段是
  • 浏阳商务局网站溪江农贸市场建设seo外包顾问