Print Page | Close Window

PDF Encryption failed

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3787
Printed Date: 02 May 24 at 5:52PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: PDF Encryption failed
Posted By: linkA
Subject: PDF Encryption failed
Date Posted: 25 Feb 20 at 10:30PM

I am trying to encrypt PDF file. But after encryption when I open output file it has plain data instead of encryption data. I checked Encrypt call, it returned 1, EncryptStatus also returned 1, which shows encryption was success.


    DebenuPDFLibraryDLL1711 DPL("DebenuPDFLibraryDLL1711.dll");
    DPL.LoadFromFile(L"2020news.pdf", L"");
    int iNumPages = DPL.PageCount();
    int EncPerm = DPL.EncodePermissions(1, 1, 1, 1, 1, 1, 1, 1);    
    //DPL.SetOrigin(1);

    int ret = DPL.Encrypt(L"",L"", 3, EncPerm);
    int st = DPL.EncryptionStatus(); 
    if (ret != 1) {
        int err = DPL.LastErrorCode();
    }

    // Attempt to save the file
     if (DPL.SaveToFile(L"hello-world2.pdf") == 1)  {
          // Display message that the 'Hello Word' file has been written successfully
    }

What am I missing here? Why encryption data was not written to outputfile? I mimicked code from "Foxit Quick PDF Library 17 Developer Guide.pdf"




Replies:
Posted By: Ingo
Date Posted: 25 Feb 20 at 10:37PM
Hi linkA,

before and after encryption you'll see the same text.
The meaning of encryption regarding the pdf file type is another one.
Try this with Google ;-)
"what means encrypt regarding pdf"

Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk