英文:
Apache docx CreateWatermark Set font in text oR CTTextPath setstyle remove double/single quotes
问题
我正在使用此处的代码,通过扩展该类进行操作:
代码片段如下:
CTTextPath shapeTextPath = shape.addNewTextpath();
shapeTextPath.setStyle("font-family:\"Cambria\";font-size:1pt");
尝试了各种组合和排列,但最终在 XML 中会将其移除,并打印如下:
<v:textpath style="font-family:Cambria;font-size:1pt" string="test"/>
需要任何帮助。应该像这样:
<v:textpath style="font-family:'Cambria';font-size:1pt" string="test"/>
(注意:以上是你所提供内容的翻译,不包括问题部分。)
英文:
I am using the code from here by extending this calss
https://svn.apache.org/viewvc/poi/tags/REL_3_17_FINAL/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java?view=markup#l416
COde from this :CTTextPath shapeTextPath = shape.addNewTextpath();
shapeTextPath.setStyle("font-family:&quot;Cambria&quot;;font-size:1pt");
Tried various combination and permutation but in the end in xml it removes it and prints like :
<v:textpath style="font-family:Cambria;font-size:1pt" string="test"/>
Any help is needed. should be like this
<v:textpath style="font-family:'Cambria';font-size:1pt" string="test"/>
专注分享java语言的经验与见解,让所有开发者获益!
评论