Box appearing around the watermark after converting the pdf to word

While converting the Excel first to pdf and then to Word, a box around the watermark text can be seen in Word format. This is fine in PDF.
I have attached the PDF and converted Word file as well to this ticket.
The code to convert these files is attached as well:


import com.aspose.cells.*
import com.aspose.pdf.*
import com.aspose.pdf.DocSaveOptions
import java.io.FileInputStream

def excelFile = '/Users/nitesh.kc/Downloads/single page excel.xlsx'
def pdfFile   = '/Users/nitesh.kc/Downloads/test pdf.pdf'
def wordFile  = '/Users/nitesh.kc/Downloads/test word.docx'

def textStampWatermark = { finalPDF, watermarkMessage ->
    TextStamp textStamp = new TextStamp(watermarkMessage)
    textStamp.setBackground(false)
    textStamp.setDraw(true)
    textStamp.setOpacity(0.5)
    textStamp.setOutlineOpacity(0.2)
    textStamp.setOutlineWidth(1)
    textStamp.setYIndent(20)
    textStamp.setRotateAngle(55)
    textStamp.getTextState().setFontSize(100)
    textStamp.horizontalAlignment = HorizontalAlignment.Center
    textStamp.verticalAlignment   = VerticalAlignment.Center
    textStamp.height = 60
    textStamp.width  = 500
    for (int x = 1; x <= finalPDF.getPages().size(); x++) {
        finalPDF.getPages().get_Item(x).addStamp(textStamp)
    }
    return finalPDF
}

// Step 1: Excel -> PDF
println "Converting Excel to PDF..."
def workbook = new com.aspose.cells.Workbook(excelFile)
workbook.save(pdfFile, com.aspose.cells.SaveFormat.PDF)
println "PDF created: ${pdfFile}"

// Step 2: Apply watermark
println "Applying watermark..."
def doc = new com.aspose.pdf.Document(pdfFile)
doc = textStampWatermark(doc, "Test Application")
doc.save(pdfFile)
println "Watermark applied"

// Step 3: PDF -> DOCX
println "Converting PDF to Word..."
def doc2 = new com.aspose.pdf.Document(pdfFile)
def saveOptions = new DocSaveOptions()
saveOptions.format = DocSaveOptions.DocFormat.DocX
doc2.save(wordFile, saveOptions)
println "Word file created: ${wordFile}"

The Aspose version we are using is:
‘com.aspose:aspose-words:26.2:jdk17’
‘com.aspose:aspose-cells:26.2’
‘com.aspose:aspose-pdf:26.1’
‘com.aspose:aspose-slides:26.2:jdk16’
test word.docx (134.1 KB)

test pdf.pdf (75.4 KB)

a { text-decoration: none; color: #464feb; } tr th, tr td { border: 1px solid #e6e6e6; } tr th { background-color: #f5f5f5; }

Could you please check why a box appears around the watermark text in the Word document?

@NiteshCG
Hi, sorry for the delay, let me check this issue a bit, I’ll write you as soon as I will finish investigation

Hello @ilyazhuykov, is there any update on this?

@NiteshCG
Hi, apologies
I tested on latest version and document seems fine
test_out.docx (144.4 KB)

Could you specify what version did you use ?

We are using the following versions:
Apose version:
implementation ‘com.aspose:aspose-words:26.2:jdk17’
implementation ‘com.aspose:aspose-cells:26.2’
implementation ‘com.aspose:aspose-pdf:26.1’
implementation ‘com.aspose:aspose-slides:26.2:jdk16’

Could you please also check the result in Dark mode in MS Word?
Thanks,
Nitesh

I’m following up on this issue, as it’s been some time since the last update. Is there any update on this?

Thanks,
Nitesh

@NiteshCG
page_apppearance.png (76.0 KB)

I have the following look of the first page both for your and my files.Could you provide example how it looks on your side?