When trying out the sample project GroupDocs.Watermark-for-Java I found out that Underline and strikeout font style is not applied to watermark text in the pdf document. Is it a bug or is there any issue in my code. Below is my changes and remaining code is as present in your github project.
package com.groupdocs.watermark.examples.basic_usage;
import com.groupdocs.watermark.Watermarker;
import com.groupdocs.watermark.common.HorizontalAlignment;
import com.groupdocs.watermark.common.VerticalAlignment;
import com.groupdocs.watermark.examples.Constants;
import com.groupdocs.watermark.watermarks.Color;
import com.groupdocs.watermark.watermarks.Font;
import com.groupdocs.watermark.watermarks.FontStyle;
import com.groupdocs.watermark.watermarks.TextWatermark;
public class AddATextWatermark {
/**
* This example demonstrates how to add a text watermark to a local document.
*/
public static void run() {
// Constants.InDocumentPdf is an absolute or relative path to your document. Ex: "C:\\Docs\\document.pdf"
Watermarker watermarker = new Watermarker(Constants.InDocumentPdf);
TextWatermark watermark = new TextWatermark("top secret", new Font("Arial", 36, FontStyle.Strikeout));
watermark.setForegroundColor(Color.getRed());
watermark.setHorizontalAlignment(HorizontalAlignment.Center);
watermark.setVerticalAlignment(VerticalAlignment.Center);
watermarker.add(watermark);
watermarker.save(Constants.OutDocumentPdf);
watermarker.close();
}
}
AND
package com.groupdocs.watermark.examples;
import com.groupdocs.watermark.examples.advanced_usage.adding_watermarks.add_watermarks_to_pdf.PdfAddWatermarks;
import com.groupdocs.watermark.examples.advanced_usage.adding_watermarks.adding_text_watermarks.AddTextWatermark;
import com.groupdocs.watermark.examples.basic_usage.AddATextWatermark;
import com.groupdocs.watermark.examples.quick_start.SetLicenseFromFile;
public class MainClass {
System.out.println("Open MainClass.java.\n");
System.out.println("In main() method uncomment the example that you want to run.");
System.out.println("=====================================================");
AddATextWatermark.run();
}