Merging files and setting user permissions

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics.

Moderators: Tracker Support, TrackerSupp-Daniel, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Andrew - Tracker Support, Tracker - Clarion Support, John - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Support Staff, moderators

Post Reply
quest-ade
User
Posts: 48
Joined: Wed Sep 28, 2005 9:20 am

Merging files and setting user permissions

Post by quest-ade » Fri Jun 16, 2006 11:44 am

Hi,

I am using PDFXCp_Merge (and associated APIs) to produce a single merged PDF from a number of other PDF documents (some that we create using your other APIs and some that are received from external sources and have been created from various applications) and want to specify what the user is able to do with this merged document.

What I would really like to do is to use PDF_SetPermissions128 so that I can just allow the user to print in high res and not edit or change the PDF in any way.

Is there a way of setting the user permissions in the same/similar way to PDF_SetPermissions128 before using PDFXCp_WriteDocument to write out the finished merged PDF?

Or is there a way to modify these permissions on an existing PDF?

Best regards,
Adrian

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Fri Jun 16, 2006 1:19 pm

Hi Adrian,

I am not sure I follow you clearly - if your question is must the file be rewritten to adjust the security/Permissions - then yes - it does, you cannot adjust the permissions of an existing file without rewriting it - and thus technically at least, altering it - even if other than this one item - the file content remains unaltered.

If I have misunderstood - could you please expand a little more on your explanation.

Thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

quest-ade
User
Posts: 48
Joined: Wed Sep 28, 2005 9:20 am

Post by quest-ade » Fri Jun 16, 2006 1:29 pm

Hi John,

Sorry for not making myself clear... when merging PDF files is it possible to adjust the user permissions after all files have been merged using PDFXCp_Merge and before the output of the merged document using PDFXCp_WriteDocument?

I cannot see that the merging API (PDFXCp_) supports this whereas the PDF creation API (PDF_) does using PDF_SetPermissions128. Unless both of these APIs can be used together somehow?

I have not found it, but you sort of hint in your reply that maybe it is possible to open up an existing PDF, change the user permissions and output the modified PDF (ie re-write it) to disk. What are the APIs that would do this?

Best regards,
Adrian

john77
User
Posts: 2
Joined: Thu Dec 09, 2004 6:13 pm

Post by john77 » Fri Jun 16, 2006 2:17 pm

Hi Adrian,

Am I correct in thinking you are using an older Build and not the latest V3.51x ?

If so : these are the required functions and as I recall there are demo app's showing how to use these to encrypt/set permissions etc.


PDFXCp_SetEncryptParameters(void* pDoc, int EncryptType);
PDFXCp_SetNewPassword(void* pDoc, const char* UserPass, int UserPassLen, const char* OwnerPass, int OwnerPassLen, int Permitions, int KeyLen);

These functions are described in the 'Encrypt' example for the 3.0 library
and of course the xcpro30.chm help file.

If you are still having any problems please advise what Dev Tool you are using and post some sample code and I will endeavour to help or ask a colleague to.

thanks.

quest-ade
User
Posts: 48
Joined: Wed Sep 28, 2005 9:20 am

Post by quest-ade » Fri Jun 16, 2006 3:01 pm

Hi John,

I am still using the older version, as per your suggestion I have successfully used the PDFXCp_SetNewPassword to do exactly what I need - many thanks.

I hadn't spotted that this API had a permissions setting - when skimming the documentation I only noticed the bit about user and owner passwords.

Many thanks for your speedy response,
Adrian

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Sat Jun 17, 2006 9:26 am

Pleasure Adrian - you should also be aware that your V3 upgrade to V3.5x is free when your ready.

download latest Releases
http://www.tracker-software.com/downloads/


Your existing serial numbers should function without issue.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

Post Reply