Skip to content

Commit

Permalink
added laravel 9 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen-oj committed Feb 22, 2022
1 parent 5cd1aaa commit 432b9b5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 266 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"require": {
"php": "^7.4|^8.0",
"illuminate/support": "^6.0|^7.0|^8.0",
"illuminate/support": "^7.0|^8.0|^9.0",
"mpdf/mpdf": "^8.0"
},
"require-dev": {
Expand Down
21 changes: 0 additions & 21 deletions src/FpdfPasswordProtectFacade.php

This file was deleted.

10 changes: 5 additions & 5 deletions src/PDFPasswordProtect.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ class PdfPasswordProtect
public function encrypt($inputFile, $outputFile, $password, $ownerPassword = null)
{
$mpdf = new \Mpdf\Mpdf();

$pagecount = $mpdf->setSourceFile($inputFile);
$tplId = $mpdf->ImportPage($pagecount);
$mpdf->UseTemplate($tplId);

//set owner password to user password if null
$ownerPassword = is_null($ownerPassword) ? $password : $ownerPassword;

$mpdf->SetProtection(array('copy', 'print'), $password, $ownerPassword);
$mpdf->Output($outputFile,\Mpdf\Output\Destination::FILE,);

$mpdf->Output($outputFile, \Mpdf\Output\Destination::FILE,);
}
}
26 changes: 1 addition & 25 deletions src/PDFPasswordProtectServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,12 @@ class PdfPasswordProtectServiceProvider extends ServiceProvider
*/
public function boot()
{
/*
* Optional methods to load your package assets
*/
// $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'pdf-password-protect');
// $this->loadViewsFrom(__DIR__.'/../resources/views', 'pdf-password-protect');
// $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
// $this->loadRoutesFrom(__DIR__.'/routes.php');


if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/../config/config.php' => config_path('pdf-password-protect.php'),
], 'config');

// Publishing the views.
/*$this->publishes([
__DIR__.'/../resources/views' => resource_path('views/vendor/pdf-password-protect'),
], 'views');*/

// Publishing assets.
/*$this->publishes([
__DIR__.'/../resources/assets' => public_path('vendor/pdf-password-protect'),
], 'assets');*/

// Publishing the translation files.
/*$this->publishes([
__DIR__.'/../resources/lang' => resource_path('lang/vendor/pdf-password-protect'),
], 'lang');*/

// Registering package commands.
// $this->commands([]);
}
}

Expand Down
214 changes: 0 additions & 214 deletions src/Scripts/FpdfProtection.php

This file was deleted.

0 comments on commit 432b9b5

Please sign in to comment.