Certificate PDF Security Password

Certificate PDF Security Password

by Asana Draper -
Number of replies: 7
I have found only one other post in 2007 and there was no response.

I need the ability to modify my students' certificates occasionally because they misspell their names or include symbols or sometimes just have general typos when they enroll. When I save and open the certificate pdfs and try to edit with Acrobat Pro, Photoshop or Illustrator, the document wants a password to modify. I have tried the admin password and the student's password but neither works.

How do I find the password to modify a pdf certificate????

Any help would be greatly appreciated!


Average of ratings: -
In reply to Asana Draper

Re: Certificate PDF Security Password

by Wayne Wenthin -
from what I remember the password is random and is never actually recorded. I had to modify the actual code but that was over a year ago.


Ok after looking there is the php file tcpdfprotection.php in mod/certficate/tcpdf I beleive if you change $this->encrypted=<notsure what it was>; to $this->encrypted=false; you will no longer have encrypted pdfs. Any other information will probably need to be gleaned from the Cpdf (http://www.ros.co.nz/pdf) which was the working model according to the headers. This is on 1.7 YMMV.

Of course this only works on anything generated after the change. My other method is to go correct the studentname in the mdl_certificate_issues and find the certificate id under the course moddata/certificate/<somenumber> and rm -rf it then regenerate the certficate.

Wayne

In reply to Wayne Wenthin

Re: Certificate PDF Security Password

by Asana Draper -
I tried to find that file and apparently I have a different version because that file doesn't exist. I did find a html2pdf.php file. It appears that this is where the protection is being written (see below). Unfortunately, I am not a php developer and am only able to edit php with very detailed instructions so I cannot pinpoint where I would need to edit the code to remove the security so perhaps changing the info in the database would work better for me. Here's the code that appears to be creating the security password:

class PDF extends FPDF_Protection
{
//variables of html parser
var $B;
var $I;
var $U;
var $HREF;
var $fontList;
var $issetfont;
var $issetcolor;

function PDF($orientation='P',$unit='mm',$format='A4')
{
//Call parent constructor
$this->FPDF_Protection($orientation,$unit,$format);
//Initialization
$this->B=0;
$this->I=0;
$this->U=0;
$this->HREF='';
$this->fontlist=array("arial","times","courier","helvetica","symbol");
$this->issetfont=false;
$this->issetcolor=false;
}
In reply to Asana Draper

Re: Certificate PDF Security Password

by Dustin Elliott -

Asana,

The file you need to edit is lib/fpdf/fpdfprotection.php

If you want to set a specific password edit the following line

function SetProtection($permissions=array(),$user_pass='',$owner_pass=null) {

I changed mine to:

function SetProtection($permissions=array(),$user_pass='',$owner_pass='Test') {

Then I was able to remove security from the newly created certificate with the password of Test.

This will only work for newly created certificates.

In reply to Asana Draper

Re: Certificate PDF Security Password

by Wayne Wenthin -
Looks like you actually need to find the class FPDF_Protection Because this line class PDF extends FPDF_Protection means exactly what it sound like. Not having worked with this version I'm at a loss. I'm not 100% certain that method 2 will work either. Hopefully our discussion will spur someone else to chime in that experience with this version of certificate.

And after I posted this I saw that someone did.

In reply to Wayne Wenthin

Re: Certificate PDF Security Password

by Chardelle Busch -
Picture of Core developers
A search for password in this forum and you would have found this post.



http://moodle.org/mod/forum/discuss.php?d=86746#p391817
In reply to Chardelle Busch

Re: Certificate PDF Security Password

by Asana Draper -

Thanks!  I had looked in this forum, but was searching for "security password" and "pdf" and totally missed that!

THANK YOU SO MUCH!

In reply to Asana Draper

Re: Certificate PDF Security Password

by E. L. Cooper -
Based on the ounce of prevention theory I edited my class sign up message to instruct students that certain uneditable records are produced from the data in your profile. Please verify proper spelling with upper and lower case on your first and surname.