事实上,现在在 ColdFusion 中提供了编辑文本的选项。它没有记录,因为该功能仍在进行中,但它确实适用于大多数情况。
为此支持添加了一些新属性。
- 您要编辑的单词必须以数组形式给出,属性名称为“wordstoredact”
-
cfpdfparam 中有一个新属性,即wordmatchingcriteria,其值为:
-
MATCHPARTIALWORD_MARKPARTIALWORD (匹配部分单词,并编辑它们)
-
MATCHPARTIALWORD_MARKWHOLEWORD(匹配部分单词,但编辑整个单词)
-
MARKWHOLEWORD(仅匹配和编辑整个单词)。
一个例子如下所示:
cfpdf(action="redact", source="#sourcefile#", destination="#destinationfile#", overwrite=true){
cfpdfparam(wordstoredact=["Windo", "disclaim"], ignorecase=true, pages="1", wordmatchingcriteria="MATCHPARTIALWORD_MARKPARTIALWORD" );
cfpdfparam(wordstoredact=["http://", "2010"], ignorecase=true, pages="1", wordmatchingcriteria="MATCHPARTIALWORD_MARKWHOLEWORD" );
cfpdfparam(wordstoredact=["December", "Resources"], ignorecase=true, pages="2", wordmatchingcriteria="MARKWHOLEWORD" );
cfpdfparam(wordstoredact=["Tutorial", "definitions"], ignorecase=false, pages="3", wordmatchingcriteria="MATCHPARTIALWORD_MARKWHOLEWORD" );
};
如果您对 ColdFusion 中基于文本的编辑有任何困惑或任何疑问,请回复