0

Is there a way for Text based redaction in ColdFusion? I can see the documentation for coordinates based alone. Code used for coordinates based redaction is:

<cfpdf action="redact" source="#sourcefile#" destination="#destinationfile#" overwrite="true">
    <cfpdfparam pages="1-2" coordinates="0,0,0,0">
</cfpdf>

Is there a similar way for text based redaction too?

4

1 回答 1

2

事实上,现在在 ColdFusion 中提供了编辑文本的选项。它没有记录,因为该功能仍在进行中,但它确实适用于大多数情况。为此支持添加了一些新属性。

  1. 您要编辑的单词必须作为属性名称为“wordstoredact”的数组给出
  2. 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 中基于文本的编辑有任何困惑或任何疑问,请回复

于 2017-02-08T08:01:59.397 回答