On Thu, 2016-01-28 at 10:18 -0800, Victor Wiedemann wrote:
> I am trying to set up encryption for this document so that it cannot be 
> edited after the pdf has been generated. I am new to c++ and have been using 
> the Hello World code, and other code as example code to build this document. 
> I cannot find any example code on how to set up the encryption or protection 
> of the PDF document. What I am trying to do is set up a digital signature 
> with encryption so that no one can edit the document for legal reasons. I am 
> sure there is an easy way to do it, but the documentation is going over my 
> head.
> 

        Hi,
you can find one simple test code here:
http://sourceforge.net/p/podofo/mailman/message/32079121/

Basically:
        PdfEncrypt *encrypt;

        encrypt = PdfEncrypt::CreatePdfEncrypt("user", "owner", 0, algo, 
keyLength);
        PODOFO_RAISE_LOGIC_IF (!encrypt, "!encrypt");

        PdfMemDocument *memDocument = new PdfMemDocument();
        PODOFO_RAISE_LOGIC_IF (!memDocument, "!memDocument");

        memDocument->SetEncrypted(*encrypt);

        delete encrypt;

where "user" is a user password (use an empty string for no user
password, thus everyone can open the document) and "owner" is an owner
password.
        Bye,
        zyx
        
-- 
http://www.litePDF.cz                                 i...@litepdf.cz



------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to