diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..49ce3c1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vendor \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..cb1cd63 --- /dev/null +++ b/composer.json @@ -0,0 +1,14 @@ +{ + "name": "leconfe/pdf-js", + "autoload": { + "psr-4": { + "PdfJs\\": "src/" + } + }, + "authors": [ + { + "name": "Leconfe" + } + ], + "require": {} +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..440df4e --- /dev/null +++ b/composer.lock @@ -0,0 +1,18 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "a0b54b5b72b876bae3f7681e749dffb7", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.3.0" +} diff --git a/index.php b/index.php new file mode 100644 index 0000000..1e0fe5a --- /dev/null +++ b/index.php @@ -0,0 +1,7 @@ +isPdf()) { + return; + } + + $media = $galley->file->media; + + $returner = response() + ->file($media->getPath(), [ + 'Content-Type' => $media->mime_type, + 'Content-Disposition' => 'inline; filename="' . $media->file_name . '"', + 'Content-Length' => $media->size, + 'Content-Transfer-Encoding' => 'binary', + 'Accept-Ranges' => 'bytes', + ]); + }); + } +}