私は iText を使用して、非常に基本的な視覚的な透かし検出器を作成しようとしています。
プログラムの最初の部分は、pdf の「UnderContent」に透かし画像を追加します。
次に、その場所で透かし画像を検出できるかどうかを確認するか、pdf の背景に透かしが含まれているかどうかを確認します。
次のようになります。
public static boolean isWatermarked(PdfReader reader) throws DocumentException, IOException{
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("/Watermark_PDFs/results.pdf"));
boolean wm = false;
if(stamper.getUnderContent(1) != null) {
wm = true;
}
stamper.close();
return wm;
}
( http://api.itextpdf.com/itext/com/itextpdf/text/pdf/PdfStamper.html#getUnderContent%28int%29 ) から getUnderContent を読んだ後、getUnderContent は、 PDFのコンテンツの下。
アンダー コンテンツに格納されているデータを読み取り、そのデータに基づいて決定を下すために使用できる方法はありますか?
ありがとう