We're sorry GroupDocs doesn't work properply without JavaScript enabled.

Free Support Forum - groupdocs.com

Underline and Strikeout font style not working watermark

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();
}

@shiva.k

Please share following details and we’ll take a look:

  • Sample and output documents
  • API version that you are using (e.g. 21.10)

Hi @Atir_Tahir below are the details and sample files.

Groupdocs watermark SDK version: 20.5
Original file : document.pdf
Converted file: converted-document.pdf
document.pdf (1.1 MB)
converted-document.pdf (1.1 MB)

1 Like

@shiva.k

This issue is reproduced at our end. Hence, we’ve logged it in our internal issue tracking system with ID WATERMARKJAVA-106. It’ll be now further investigated. You’ll be notified in case of any progress.

@Atir_Tahir what is the status of this issue.

@shiva.k

This issue is still under investigation. We’ll let you know in case of any update.

Hi I request to give status of this bug.

@shiva.k

This issue is still under investigation. You’ll be notified as we have any progress update or ETA.