Two Pilots™    Home  |  Navigation  |  Site Map  |  Products  |  Download  |  Prices  |  For Partners  |  Support


All forums · Statistics · Search ·

Two Pilots forum / For software developers / Can't disable printing (and instability issues)!
Author Message
Anonymous
# Posted: 1 Mar 2007 15:17


Hi,

We wanted to add the possibility to disable printing in our PDF-documents. At the same time we upgraded to version 3.2. Unfortunately I don't manage to disable printing (did this work in earlier versions?). Fooled around with your example and no matter how I initiated the protectionvariables, the printing where still available.

// initialize PDF Engine
PDF->StartEngine("demo","demo");

PDF->DocumentInfo_Title = "test";
PDF->FileName = "test.pdf";
PDF->Version = v14;
PDF->ProtectionEnabled = true;
PDF->ProtectionKeyLength = ckl40;
PDF->ProtectionOptions_coPrint = false;
PDF->AutoLaunch = true;


// start document generation
PDF->BeginDoc();

PDF->PDFPAGE_Orientation = (TxPDFPageOrientation)0;
PDF->PDFPAGE_Size = psA4;

// draw "HELLO, PDF" message on the current PDF page

// draw text
RECT R;
R.bottom = 400;
R.right = 400;
R.left = 10;
R.top = 10;
DrawText((HDC)PDF->HDC,"HELLO, PDF!",11,&R,DT_CENTER);

// finalize document generation
PDF->EndDoc();

Anonymous
# Posted: 1 Mar 2007 15:22


Sorry about the instability issues. I forgot to change the title. Had an AcrobatReader in the background with the generated file open. This resulted in a crash.

Anonymous
# Posted: 4 Mar 2007 15:49


I've tried the same code in version 3.0 and can't get it to work. Any comments?

Stanislav
Member
# Posted: 5 Mar 2007 03:56


Hello,

Please use OwnerPassword property:

PDF.OwnerPassword = "your_password"

Best regards,
Stanislav
Two Pilots
www.colorpilot.com

 

 

Powered by miniBB 2.0 RC7 © 2001-2004 Page creation time (sec.): 0.014

 

Page top