Agregar sello de goma

Agregar un sello de goma

  1. Vincule el PDF de origen a la fachada PdfContentEditor.
  2. Llame createRubberStamp(...) con el número de página, rectángulo, título, contenido y color.
  3. Guarde el documento PDF actualizado.
public static void addRubberStamp(Path inputFile, Path outputFile) {
    PdfContentEditor editor = new PdfContentEditor();
    try {
        editor.bindPdf(inputFile.toString());
        editor.createRubberStamp(1, new Rectangle(120, 450, 180, 60), "Approved", "Approved by reviewer", Color.GREEN);
        editor.save(outputFile.toString());
    } finally {
        editor.close();
    }
}