Necesito ayuda para desbloquear documentos PDF encriptados.Problema Desbloqueo de contraseña Documentos PDF protegidos
He intentado lo siguiente sin éxito.
CFURLRef pdfURL = CFURLCreateWithFileSystemPath (NULL, documentsDirectory, kCFURLPOSIXPathStyle, 0); //1
pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL);
BOOL encrypted = CGPDFDocumentIsEncrypted(pdf);
if (encrypted) {
// Try 1:
const char *str = (char *)theTextField.text;
BOOL _unlock = CGPDFDocumentUnlockWithPassword(pdf,str);
//Try 2:
NSString *str1 = @"password";
BOOL _unlock1 = CGPDFDocumentUnlockWithPassword(pdf,str1);
}
Me aseguré de que la contraseña sea correcta pero la función de desbloqueo aún devuelve False.
¿He olvidado algo? ¿¿Hay algo mal??
Saludos, Arun Thakkar.
Tnx marcus y Arun Thakkar, ambos me ayudaron a lograr mi tarea – Dinakar