Mike
Mike

Reputation: 1

Python - Remove watermark from pdf files

I created a simple script to convert rtf file to pdf. The script worked perfect, but I found it has watermark on each converted pdf file. I tried to use "watermark.remove()", it seems it doesn't work for my script. Could anyone help me to take a look at it and let me know how to do it correctly. Thanks.

Here is my script:

import aspose.words as aw
import fnmatch
import os
import sys
import os,os.path
import comtypes.client

# load RTF document

source_path = "file_path"
dest_path = "output_path"

in_file = []  # save the source file to an array

for in_file in os.listdir(source_path):
    if fnmatch.fnmatch(in_file,'*.rtf'):
        doc = aw.Document(source_path+in_file)
        out_name = os.path.splitext(in_file)[0]  # get file name only
        print (out_name) # print the file name


        doc.watermark.remove() #remove the watermark


        doc.save(dest_path+out_name+".pdf", aw.SaveFormat.PDF)

Upvotes: 0

Views: 3010

Answers (1)

enzo
enzo

Reputation: 11506

The section "Licensing and Subscription" from the documentation says that (emphasis mine)

The Trial version of Aspose.Words without the specified license provides full product functionality, but inserts an evaluative watermark at the top of the document upon loading and saving and limits the maximum document size to a few hundred paragraphs.

So you may consider purchasing the license or request a 30-day temporary license.

Upvotes: 1

Related Questions