Hello,
How do you not allow content copying from PDF file programmatically.
Is there any way you do not allow copying some content of the file but still can copy other part of the file.
I am using C++ and PDF-XChange 3.0 and converting Excel to PDF programmatically.
Following is the sample code for the way I use the PDF-XChange to convert Excel to PDF
SaverObj.CreateInstance(__uuidof(CPXCControl ));
SaverObj->SetParamStr(0,"Save.FullFileName",(LPCTSTR)pdfFileName);
SaverObj->SetParamStr(0,"Save.ShowSaveDialog", "No");
.....
WorkBook._Printout(,,,...,PDFPRINTERNAME,..)
Please help me soon as possible as this is an urgent issue.
Thanks in advance
Allow Content copying
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Stefan - PDF-XChange
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: Allow Content copying
Hello mpatel,
I believe you have posted in the wrong forum
As for the permissions yes they can be set using PXCp_SetPermissions , but this is a XCPRO40 Library function and I am not sure it is available in ver3.
Best,
Stefan
I believe you have posted in the wrong forum

As for the permissions yes they can be set using PXCp_SetPermissions , but this is a XCPRO40 Library function and I am not sure it is available in ver3.
Best,
Stefan
-
- User
- Posts: 30
- Joined: Fri Mar 26, 2010 4:06 pm
Re: Allow Content copying
Do you have any code sample for that?
And can we set permission to particular content rather than on whole file content.
Thanks for your reply
And can we set permission to particular content rather than on whole file content.
Thanks for your reply
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: Allow Content copying
Taken directly from the manual 
Example (C++):
Or at PDF Creation time:
Cheers,
Stefan

Example (C++):
Code: Select all
PDFDocument hDocument = NULL;
DWORD Permissions = 0;
// Permits document printing and extracting text and graphics:
Permissions = Permit_Printing | Permit_TextGraphicsExtractions;
// Set this options (key length will be set to 40):
HRESULT res = PXCp_SetPermissions(&hDocument, 40, Permissions);
if (IS_DS_FAILED(res))
{
// Report an error
}
...
// Clean up
PXCp_Delete(hDocument);
Code: Select all
_PXCDocument* pdf;
...
// Sets the encryption level to 40 bits
// and only permit to print the document
HRESULT res = PXC_SetPermissions(pdf, 40, Permit_Printing);
if (IS_DS_FAILED(res))
{
// Handle error
}
...
Cheers,
Stefan
-
- User
- Posts: 30
- Joined: Fri Mar 26, 2010 4:06 pm
Re: Allow Content copying
Can you give me a link from where i can download the manual.
Thanks
Thanks
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: Allow Content copying
Hello mpatel,
It comes along with the ver4 SDKs - there is no link just for that manual I believe, so here is a direct one for the ver4 PRO SDK:
https://www.pdf-xchange.com/downloa ... DKPRO4.zip
Best,
Stefan
It comes along with the ver4 SDKs - there is no link just for that manual I believe, so here is a direct one for the ver4 PRO SDK:
https://www.pdf-xchange.com/downloa ... DKPRO4.zip
Best,
Stefan
-
- User
- Posts: 30
- Joined: Fri Mar 26, 2010 4:06 pm
Re: Allow Content copying
I think you forgot to answer this question
Can we set permission to particular content rather than on whole file content.
Meaning i want user not to copy some portion of the file but they can copy other portion of the file.
Thanks
Can we set permission to particular content rather than on whole file content.
Meaning i want user not to copy some portion of the file but they can copy other portion of the file.
Thanks
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: Allow Content copying
Hi,
All of the above settings are applied on the document Layer, and affect the whole document.
Cheers,
Stefan
All of the above settings are applied on the document Layer, and affect the whole document.
Cheers,
Stefan
-
- User
- Posts: 30
- Joined: Fri Mar 26, 2010 4:06 pm
Re: Allow Content copying
Hello,
THanks for your help.
i was able to apply security settings for 4.0 but
I would like to know can we apply Security settings on 3.0 or not because when you see
printer settings for 3.0 it does allow to change these security settings but some how i am not able to do it by code
here are the settings that i am using for 3.0
pxc30COM::IPXCControlPtr SaverObj = NULL;
HRESULT hr = SaverObj.CreateInstance(__uuidof(CPXCControl ));
SaverObj->SetParamStr(0, "Security.Enabled", "True");
SaverObj->SetParamStr(0, "Security.Type", "2");
SaverObj->SetParamStr(0, "Security.Perms128.ContentAccess", "False");
SaverObj->SetParamStr(0, "Security.Perms128.AllowCopying", "False");
SaverObj->SetParamStr(0, "Security.Perms128.Printing", "0");
I am using same settings for 4.0 but it is not working only difference is I am using PXCComLib.CPXCControlEx
Thanks for youe help again in advance.
Thanks
THanks for your help.
i was able to apply security settings for 4.0 but
I would like to know can we apply Security settings on 3.0 or not because when you see
printer settings for 3.0 it does allow to change these security settings but some how i am not able to do it by code
here are the settings that i am using for 3.0
pxc30COM::IPXCControlPtr SaverObj = NULL;
HRESULT hr = SaverObj.CreateInstance(__uuidof(CPXCControl ));
SaverObj->SetParamStr(0, "Security.Enabled", "True");
SaverObj->SetParamStr(0, "Security.Type", "2");
SaverObj->SetParamStr(0, "Security.Perms128.ContentAccess", "False");
SaverObj->SetParamStr(0, "Security.Perms128.AllowCopying", "False");
SaverObj->SetParamStr(0, "Security.Perms128.Printing", "0");
I am using same settings for 4.0 but it is not working only difference is I am using PXCComLib.CPXCControlEx
Thanks for youe help again in advance.
Thanks
-
- Site Admin
- Posts: 5223
- Joined: Tue Jun 29, 2004 10:34 am
Re: Allow Content copying
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
Best regards
Tracker Support
http://www.tracker-software.com