New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printing PDF file requires password under windows but not under Linux #429

Closed
CaptainChristian opened this Issue Jan 8, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@CaptainChristian
Copy link

CaptainChristian commented Jan 8, 2019

Hi there!
Happy New year everyone!
I call on Spipu/html2pdf in my scripts developed under Linux and it works fine
However when one tries to print such files with a computer under Windows, the file is edited but printing is not permitted without a password
How to suppress such requirement?
Thanks for any help
CaptainChristian

@LittleBigFox

This comment has been minimized.

Copy link
Contributor

LittleBigFox commented Jan 9, 2019

Hi Christian.
I've never saw such a thing with Html2pdf... Don't you have a .htaccess with file protection?
Regards,
LBF

@CaptainChristian

This comment has been minimized.

Copy link

CaptainChristian commented Jan 9, 2019

Hi LBF, glad to hear from you again this year!

No I didn't insert any .htaccess anywhere in my codes

However, I've just discovered something which bothers me: SetProtection(array('print'));

$content= ob_get_clean(); //require_once(dirname(__FILE__).'/html2pdf/html2pdf.class.php'); require_once'../dossier/vendor/autoload.php'; use Spipu\Html2Pdf\Html2Pdf; try { $pdf = new HTML2PDF('P','A4','fr'); $pdf->pdf->SetDisplayMode('fullpage'); **$pdf->pdf->SetProtection(array('print'));** $pdf->writeHTML($content); $pdf->Output($nompdf,'D'); } catch(HTML2PDF_exception $e) { echo $e->getMessage(); exit; }

I don't remember why I put it in there..
What do you think?
Regards
CaptainChristian

@LittleBigFox

This comment has been minimized.

Copy link
Contributor

LittleBigFox commented Jan 11, 2019

Hi Christian!

You're right, it's a TCPDF method, have a look:
https://github.com/spipu/html2pdf/blob/master/doc/tcpdf_methods.md#document-protection

I didn't know about it, but it'll may be clearly usefull, for sure!

Regards,
LBF

@CaptainChristian

This comment has been minimized.

Copy link

CaptainChristian commented Jan 13, 2019

Thanks LBF for this usefull reminder
Regards
Captainchristian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment