I used pdf license keys for password protected pdf conversion

I used pdf license keys for password protected pdf conversion.
But still i am getting watermak like below

Please check attached converted pdf file with password : AAAAA2222A
CIBIL-Report-2025-08-01_17-41-32.pdf (99.1 KB)

@RushikeshKondke Your question is related to Aspose.PDF. So I will move it to the appropriate forum category. My colleagues will help you shortly.

@RushikeshKondke
Could you provide code & source document you used for conversion and version of Aspose Pdf you used to get such result?

We are using this class for converting word to pdf.

public class AsposeLicenseManager
{
    private static AsposeLicenseManager _instance;
    private static readonly object _lock = new object();
    Metered metered1;
    private AsposeLicenseManager()
    {            
        try
        {
            metered1 = new Aspose.Words.Metered();
            metered1.SetMeteredKey("asposenet986956094f194b22ab3b3697fcc0df75",
                                    "WFq0YOWyLxlC4cDoHq2DNO8O4v4nOqOFi4LUMBxjr9Daek71Aba1lNdToZ8mUKCRZhQAF3Z6QplNUaRUWf7riHUjDqg2EyrEONF4kLeUIFL4eb-LPQo2LG5ytar5oxuRsIUY2adoKP7AjXvThDV3OLWjUTos2hYGrXvDa1qQcPQp0NSWnVFO9Zj-FHU1QQXqecj80jleeJENWipzGz0Pcxv72vPAI0xkRQwlipxarxQrzBOp6iJG7GV7CZtoW7RPG7VZKGFvg8JPDqE3UjLRG064A9bYe1ngHwkpxaoJ57dcDHqhF9S-FJfLEYeorep7oZNX931nvp-urZKTCw__");
            metered1.SetMeteredKey("asposenet7f0c194bff03473ab4c5f06b9e5320ae",
                                   "dp7XInH-VwWtnK08VYk7vKLT0tBg0kep8HcmupCHK5m2ufVWAw6FPCyz8lfCFt0XcyWG2qVFz6ANHajBj5ujj6U89CGV3h9OuunvDt8HuydgcjDEPNcQ7wUPy78VoOmll4ZgsDVAh0PXHYfSg-Z9bhdI10BIdezo6DGMucmAcADGFx5hTRPwX4zOpkuMCsAjvWnLdTH3IYHhEmMWy9tY7HSm4qvmSYfp18uwQtVcNN1bGdZ-AkJ8f2qVi7PZNUvQGhBBR6glUoTxXFFWO6eda8KaExWHeql3mIlblsAi0gtGbfYNhHnC0aem9GAKYSD2eeeDUrBJoJJxpLNMaouw__");
            metered1.SetMeteredKey("asposenetb66f7622377d4eb4b7cecfaf565ea29e",
                                            "wmhifYpCGMVgEOQg-l8FkxsqwYD3nHWQbOdwcCDR1Sd5gDEVps7WQBiaJ0qu8vv3BxOcpvEIHL8fXPdDkdcxbWR7BPnCUIwKBVQx8VIx4082RMTOprtAfCOff4NVCIghOISgEo1qYk4GGu1EbZcW9p3Na5iTFseYTuVt1CJ4O3872Qt73VwVFB23-q3zOfJpZhNr-gM5DQgx9lhyu0snkFXAveAnhG7QT8wsBH5ax3Nj0RJ8VgRxeWjqZ6vibkQMLGcjcLh0OC42NpCIghly4vuD8sPzu22lqy7Sas7NIfcJSGDWnK9SVy6PqKY4X1SAto-Yn5T3*2p5Ej-lIWiQ__");
        }
        catch (Exception ex)
        {

        }           
    }

    public static AsposeLicenseManager Instance
    {
        get
        {
            lock (_lock)
            {
                if (_instance == null)
                {
                    _instance = new AsposeLicenseManager();
                }
                return _instance;
            }
        }
    }
}

But here we are adding password protection to existing pdf

public void ProtectPdf(string inputPath, string outputPath, string userPassword, string ownerPassword)
{
    // Load the existing PDF
    var pdfDocument = new Document(inputPath);

    // Set encryption with permissions
    pdfDocument.Encrypt(
        userPassword,         // Password required to open the document
        ownerPassword,        // Password required to change permissions
        Permissions.PrintDocument | Permissions.ModifyContent, // Allowed actions
        CryptoAlgorithm.AESx128   // Encryption level
    );

    // Save the protected PDF
    pdfDocument.Save(outputPath);
}

Please check with attached pdf , Also if code not works then give me sample code for this issue
SampleNotice.pdf (115.1 KB)

@RushikeshKondke
By first glance it seems that you set metered license for Aspose.Words but you work with Aspose.Pdf which has separate license, therefore you get watermark in result document. You can set Aspose.Pdf metered license before calling Aspose.Pdf code or use Aspose.Total to switch freely between Aspose solutions in your code
The code I used:

static void license_issue()
{
    Aspose.Pdf.License license = new Aspose.Pdf.License();
    license.SetLicense(InputFolder + "Aspose.Pdf.lic");

    string input = InputFolder + "SampleNotice.pdf";
    string output = OutputFolder + "SampleNotice_out.pdf";

    using (var pdfDocument = new Document(input))
    {
        var userPassword = "AAAAA2222A";
        var ownerPassword = "AAAAA2222A";
        // Set encryption with permissions
        pdfDocument.Encrypt(
            userPassword,         // Password required to open the document
            ownerPassword,        // Password required to change permissions
            Permissions.PrintDocument | Permissions.ModifyContent, // Allowed actions
            CryptoAlgorithm.AESx128   // Encryption level
        );

        // Save the protected PDF
        pdfDocument.Save(output);

    }
}

and the result document without watermark
SampleNotice_out.pdf (117.0 KB)

I am getting authentication failed error, I am using metered keys
image.png (112.2 KB)

Please check below code

using System;
using System.IO;
using Aspose.Pdf;
using Aspose.Words;

public class Program
{
    private static void Main(string[] args)
    {
        string baseFolder = AppContext.BaseDirectory;
        string inputFolder = Path.Combine(baseFolder, "Input") + Path.DirectorySeparatorChar;
        string outputFolder = Path.Combine(baseFolder, "Output") + Path.DirectorySeparatorChar;

        Directory.CreateDirectory(inputFolder);
        Directory.CreateDirectory(outputFolder);

        string inputPdf = Path.Combine(inputFolder, "SampleNotice.pdf");
        string outputPdf = Path.Combine(outputFolder, "SampleNotice_out.pdf");
         
        var metered = new Aspose.Pdf.Metered();
        metered.SetMeteredKey("asposenet986956094f194b22ab3b3697fcc0df75",
                                    "WFq0YOWyLxlC4cDoHq2DNO8O4v4nOqOFi4LUMBxjr9Daek71Aba1lNdToZ8mUKCRZhQAF3Z6QplNUaRUWf7riHUjDqg2EyrEONF4kLeUIFL4eb-LPQo2LG5ytar5oxuRsIUY2adoKP7AjXvThDV3OLWjUTos2hYGrXvDa1qQcPQp0NSWnVFO9Zj-FHU1QQXqecj80jleeJENWipzGz0Pcxv72vPAI0xkRQwlipxarxQrzBOp6iJG7GV7CZtoW7RPG7VZKGFvg8JPDqE3UjLRG064A9bYe1ngHwkpxaoJ57dcDHqhF9S-FJfLEYeorep7oZNX931nvp-urZKTCw__"); Console.WriteLine("Metered license applied via keys."); // If keys are invalid or consumption fails for >24h, you may need to re-call per docs.
            
           

            if (!File.Exists(inputPdf))
            {
                Console.Error.WriteLine($"Input PDF not found: {inputPdf}");
                return;
            }

            using (var pdfDocument = new Aspose.Pdf.Document(inputPdf))
            {
                string userPassword = "AAAAA2222A";
                string ownerPassword = "AAAAA2222A";

                // Permissions: allow printing and modifying content
                Permissions permissions = Permissions.PrintDocument | Permissions.ModifyContent;

                // Encrypt with AES128
                pdfDocument.Encrypt(
                    userPassword,
                    ownerPassword,
                    permissions,
                    CryptoAlgorithm.AESx128
                );

                pdfDocument.Save(outputPdf);
                Console.WriteLine($"Encrypted PDF saved to: {outputPdf}");
            }
    }
}

@RushikeshKondke
It seems you’re using same key for metered license as in code above for Aspose.Words. Judging by result in original code and issue with identification error you’ll need another key for Aspose.Pdf/Aspose.Total to resolve this issue

No, i have aspose words, pdf and converter metered keys…

I used same metered keys that i got in aspose pdf .lic file

please check attached file code…

I tried by using directly .lic file same like your code but its not worked.

@RushikeshKondke
Understood, thank you for explanation
I’ll ask development team for explanation and write you back as soon as possible - it’s weird that metered license doesn’t work in this case
Just in case, is it possible that license has expired?

No its been just around 20 days i got license file

@RushikeshKondke
Thank you for information. I wrote to development team, as soon I’ll get explanation I’ll write back.

@RushikeshKondke
I was asked to provide order id in order for license team to check the issue. Could you share it, please?

Please check

1 Like

@RushikeshKondke You do not have a license for Aspose.PDF. You have three Aspose.Words plugin licenses.

Aspose.Words PDF File Processor allow loading PDF documents using Aspose.Words, not using Aspose.PDF.

Thanks for the Info.

Let me only Aspose.Words PDF File Processor i need to purchase or any other also i need to purchase to make pdf with password protected.

@RushikeshKondke You can use Aspose.Words to save password protected PDF. Please see our documentation for more information:
https://reference.aspose.com/words/net/aspose.words.saving/pdfsaveoptions/encryptiondetails/

@RushikeshKondke
License team suggested that there could be an error in copied pdf key as there’s “*” symbol is missing and authentification error could be caused by this
error_cause.jpg (84.3 KB)

still same issue
image.png (129.2 KB)

@RushikeshKondke
in this case it seems that Pdf File Processor plugin license doesn’t work as Aspose.Pdf license and you’ll need separate one

Which one ? Please guide me