possible restrictions to PDF?

431 views
Skip to first unread message

allanh

unread,
Feb 9, 2012, 11:45:18 AM2/9/12
to dompdf
Hello everyone!
Congratulations on your work.
I was wondering if you could do something.
allow restrictions to pdf.
as: printing, etc. modify document?
It is possible?
Thank you.

BrianS

unread,
Feb 9, 2012, 12:20:00 PM2/9/12
to dom...@googlegroups.com
On Thursday, February 9, 2012 11:45:18 AM UTC-5, allanh wrote:
I was wondering if you could do something.
allow restrictions to pdf.
as: printing, etc. modify document?
It is possible?

If you're using the CPDF back end you would do something like the following:

$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->get_canvas()->get_cpdf()->setEncryption('userpass', 'ownerpass', array('print'));
$dompdf->stream('protected.pdf');

userpass/ownerpass are the passwords for opening the document. If you leave the owner password blank it will be set to the same as user password. The options available for the user permission array are: print, modify, copy, add.

BrianS

unread,
Feb 9, 2012, 12:22:47 PM2/9/12
to dom...@googlegroups.com

I should note that there is a bug that needs to be addressed that may affect the appearance of your PDF when you're using embedded fonts. You can watch for a resolution in the issue tracker.
Reply all
Reply to author
Forward
0 new messages