Apache docx CreateWatermark Set font in text oR CTTextPath setstyle remove double/single quotes

huangapple 未分类评论52阅读模式
英文:

Apache docx CreateWatermark Set font in text oR CTTextPath setstyle remove double/single quotes

问题

我正在使用此处的代码,通过扩展该类进行操作:

https://svn.apache.org/viewvc/poi/tags/REL_3_17_FINAL/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java?view=markup#l416

代码片段如下:

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(&quot;font-family:&amp;quot;Cambria&amp;quot;;font-size:1pt&quot;);

Tried various combination and permutation but in the end in xml it removes it and prints like :

&lt;v:textpath style=&quot;font-family:Cambria;font-size:1pt&quot; string=&quot;test&quot;/&gt;

Any help is needed. should be like this

&lt;v:textpath style=&quot;font-family:&#39;Cambria&#39;;font-size:1pt&quot; string=&quot;test&quot;/&gt;

huangapple
  • 本文由 发表于 2020年7月23日 22:05:59
  • 转载请务必保留本文链接:https://java.coder-hub.com/63056200.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定