Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, August 8, 2006 8:06:03 PM(UTC)

hakisme  
hakisme

Groups: Registered
Posts: 4


hi 

I am a korean...so my english is short....sorry..

I want make Encrypt pdf  file use leadtools 14

That is my Code but not working...

please let me know

 

void CLtPasswordDlg::OnButton1()
{
 BITMAPHANDLE bm;
 long   nRtn;

 FILEPDFSAVEOPTIONS pdfSaveOptions;

 L_UnlockSupport(L_SUPPORT_PDF,"********");
 L_UnlockSupport(L_SUPPORT_PDF_SAVE, "*******");

 

 nRtn = L_LoadBitmap("c:\\00001.bmp", &bm, sizeof(BITMAPHANDLE), 0, 0, NULL, NULL);

 L_GetPDFSaveOptions( &pdfSaveOptions, sizeof(pdfSaveOptions));
 
 pdfSaveOptions.uStructSize = sizeof( pdfSaveOptions );
 pdfSaveOptions.b128bit = TRUE;
 strcpy((char*)pdfSaveOptions.szUserPassword,"szUser");
 strcpy((char*)pdfSaveOptions.szOwnerPassword,"szOwner");

 if(strlen( (char*)pdfSaveOptions.szOwnerPassword ) > 0 ||strlen( (char*)pdfSaveOptions.szUserPassword ) > 0 )
 {
  pdfSaveOptions.uStructSize = sizeof( pdfSaveOptions );
  pdfSaveOptions.dwEncryptFlags |= PDF_SECURITYFLAGS_REV2_PRINTDOCUMENT;
  if( pdfSaveOptions.b128bit )
  {
    pdfSaveOptions.dwEncryptFlags |= PDF_SECURITYFLAGS_REV3_PRINTFAITHFUL;
  }

  L_SetPDFSaveOptions( &pdfSaveOptions );
 }
 nRtn = L_SaveBitmap("c:\\aa1.pdf",&bm,FILE_RAS_PDF ,8, 125,NULL);
 L_FreeBitmap(&bm);
 
}

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, August 10, 2006 6:40:39 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)


Hello Sir,




I have tried your code sample in a small application and it
worked fine. I would like you to check the return values of all LEADTOOLS
functions in your code and tell me if any of them return other than SUCCESS
(1), in order to pinpoint the problem. Also please let me know how the
encryption fails? I got a file that only opens If I give it one of the 2 passwords. I will be waiting for your feedback.


Kind regards,

 
#3 Posted : Thursday, August 10, 2006 4:19:16 PM(UTC)

hakisme  
hakisme

Groups: Registered
Posts: 4


hello~~^.^;


Thanks your reply..

My result is...

1. "aa1.pdf" file is maked OK

2. but when i open that file using Adobe Acrobat reader...
    Acrobat reader don't  Ask " Insert Password"


  ( I Think....Why don't Ask password????,   I give password.....???)

 
I want to make pdf file that need PassWord..

Bye~~~

 
#4 Posted : Monday, August 14, 2006 1:06:55 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)


Hello Sir,

Please find the attached project that produces a PDF which
causes Acrobat to ask the user to insert a password when trying to open it. I
have used the code you provided me with in your previous email. If you could
please test this project on your machine and let me know if the problem
occurred again.


Note: To be able to run the project, you need to uncomment the "L_UnlockSupport" code lines and type your lock keys there.




Kind regards,

File Attachment(s):
PDFPassword.zip (257kb) downloaded 37 time(s).
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.102 seconds.