Allow Content copying

PDF-XChange Drivers API (only) V4/V5
This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - VERSION 4 & 5 - Please use the PDF-Tools SDK Forum for Library DLL assistance.

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Stefan - PDF-XChange

mpatel
User
Posts: 30
Joined: Fri Mar 26, 2010 4:06 pm

Allow Content copying

Post by mpatel »

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
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Allow Content copying

Post by Stefan - PDF-XChange »

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
mpatel
User
Posts: 30
Joined: Fri Mar 26, 2010 4:06 pm

Re: Allow Content copying

Post by mpatel »

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
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Allow Content copying

Post by Stefan - PDF-XChange »

Taken directly from the manual :)

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); 
Or at PDF Creation time:

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
mpatel
User
Posts: 30
Joined: Fri Mar 26, 2010 4:06 pm

Re: Allow Content copying

Post by mpatel »

Can you give me a link from where i can download the manual.

Thanks
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Allow Content copying

Post by Stefan - PDF-XChange »

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
mpatel
User
Posts: 30
Joined: Fri Mar 26, 2010 4:06 pm

Re: Allow Content copying

Post by mpatel »

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
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Allow Content copying

Post by Stefan - PDF-XChange »

Hi,

All of the above settings are applied on the document Layer, and affect the whole document.

Cheers,
Stefan
mpatel
User
Posts: 30
Joined: Fri Mar 26, 2010 4:06 pm

Re: Allow Content copying

Post by mpatel »

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
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Allow Content copying

Post by John - Tracker Supp »

please see your duplicated post ...

https://forum.pdf-xchange.com/ ... =43&t=8063
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