Print Page | Close Window

How to disable copying of Text

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=1419
Printed Date: 03 May 24 at 10:12PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: How to disable copying of Text
Posted By: mburian
Subject: How to disable copying of Text
Date Posted: 20 Apr 10 at 9:51PM
Hi All,  Is there a way to disable copying of text, i.e copy to clipboard, edit... copy etc. from created PDF documents

-------------
Mick Burian



Replies:
Posted By: Ingo
Date Posted: 20 Apr 10 at 10:01PM
Hi Mick!

I'm a bit astonished? What's your problem?
Please read in the samples section and have a look in the reference.
You asked this already and there's an answer, too?
But again: Yes, you can do this. First use "permission" and then "encrypt".
Have a look in the online reference i fear you can't avoid this ;-)

Cheers, Ingo



Posted By: mburian
Date Posted: 23 Apr 10 at 11:12PM
I am sorry but I cannot find the section that helps me with this!
Trust me Ingo, I have looked everywhere but I cannot find a sample that will show me how do disable copying of text from the menu.


-------------
Mick Burian


Posted By: Ingo
Date Posted: 23 Apr 10 at 11:42PM
Mick!

You don't need a sample. The library has over 500 functions.
I can't imagine that you want a sample for each function?
Your a developer... You know how to create, unlock, load and free...
and between load and free you can call the functions.

Here's a partly sample from my app:

// First the create and unlock and LoadFromFile then
// . . .
// in my app you can select which security stuff
// and encryption level you want ...
   p5 := 9;
   If Pos('40', Trim(seclev.Text))  > 0 Then p5 := 0;
   If Pos('128', Trim(seclev.Text)) > 0 Then p5 := 1;
   If Pos('AES', Trim(seclev.Text)) > 0 Then p5 := 2;
   If Trim(print.Text)    = 'Yes'        Then p6 := 1  else p6 := 0;
   If Trim(copy.Text)     = 'Yes'        Then p7 := 1  else p7 := 0;
   If Trim(change.Text)   = 'Yes'        Then p8 := 1  else p8 := 0;
   If Trim(field.Text)    = 'Yes'        Then p9 := 1  else p9 := 0;
   If Trim(comment.Text)  = 'Yes'        Then p10 := 1 else p10 := 0;
   If Trim(access.Text)   = 'Yes'        Then p11 := 1 else p11 := 0;
   If Trim(assemb.Text)   = 'Yes'        Then p12 := 1 else p12 := 0;
// . . .
// few security settings only work with 128 bit encryption so ...
   If p5 = 0 Then
   begin
      p9  := 0;
      p11 := 0;
      p12 := 0;
   end;
// . . .
// now you create the permission string ...
   perm := QPL.EncodePermissions(p6, p7, p8, p10, p9, p11, p12, 0);
// . . .
// let the userpassword be a ''. That's better ;-)
   QP.EncryptFile(oldfilename, newfilename, mainpassword, userpassword, p5, perm);
// . . .
// a Free ... and that's it ;-)

Cheers, Ingo


Posted By: mburian
Date Posted: 24 Apr 10 at 12:01AM
OK... I have found the commands to do this but am getting a message...
My steps are...
 
1. Code used:
 
    hPermissions = QP.Permissions(1, 0, 1, 1, 1, 1, 1, 1)
    hPermissions = QP.Encrypt("", "", 1, hPermissions)
 
I do not want to use a password....
 
2. Result when opening document
'An unrecognized token was found when opening the document.
Document still opens.
 
3. When trying to save document, I get an 'Unable to save document error(110)'
 
 


-------------
Mick Burian


Posted By: mburian
Date Posted: 24 Apr 10 at 12:13AM
Thanks Ingo,
 
So to understand...
 
I need to create the PDF, then save the document to a file, then loadfrom file and encode the permissions and then encrypt to a new file?


-------------
Mick Burian


Posted By: mburian
Date Posted: 24 Apr 10 at 12:20AM
Thanks again Ingo...  I have it working...

-------------
Mick Burian


Posted By: Ingo
Date Posted: 24 Apr 10 at 8:27PM
Thank God. I began going crazy ;-)
BTW: If it's working now you should post your code in the samples-section for the next.

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