<excludeFolder url="file://$MODULE_DIR$/vendor/graham-campbell/result-type" />
<excludeFolder url="file://$MODULE_DIR$/vendor/swiftmailer/swiftmailer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/tijsverkoyen/css-to-inline-styles" />
+ <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/debug" />
+ <excludeFolder url="file://$MODULE_DIR$/vendor/maximebf/debugbar" />
+ <excludeFolder url="file://$MODULE_DIR$/vendor/barryvdh/laravel-debugbar" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<path value="$PROJECT_DIR$/vendor/graham-campbell/result-type" />
<path value="$PROJECT_DIR$/vendor/swiftmailer/swiftmailer" />
<path value="$PROJECT_DIR$/vendor/tijsverkoyen/css-to-inline-styles" />
+ <path value="$PROJECT_DIR$/vendor/symfony/debug" />
+ <path value="$PROJECT_DIR$/vendor/maximebf/debugbar" />
+ <path value="$PROJECT_DIR$/vendor/barryvdh/laravel-debugbar" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7" />
"ext-iconv": "*",
"ext-gd": "*",
"laravel/framework": "~5.8|^6.0|^7.0|^8.0",
- "cubist/util": "dev-master"
+ "cubist/util": "dev-master",
+ "barryvdh/laravel-debugbar": "^3.6"
}
}
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "84f69f8ecd17cfe2cb76a4623050f8ee",
+ "content-hash": "1edb8d7b03dad14ee29f7130f3eb088b",
"packages": [
+ {
+ "name": "barryvdh/laravel-debugbar",
+ "version": "v3.6.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/barryvdh/laravel-debugbar.git",
+ "reference": "70b89754913fd89fef16d0170a91dbc2a5cd633a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/70b89754913fd89fef16d0170a91dbc2a5cd633a",
+ "reference": "70b89754913fd89fef16d0170a91dbc2a5cd633a",
+ "shasum": ""
+ },
+ "require": {
+ "illuminate/routing": "^6|^7|^8",
+ "illuminate/session": "^6|^7|^8",
+ "illuminate/support": "^6|^7|^8",
+ "maximebf/debugbar": "^1.16.3",
+ "php": ">=7.2",
+ "symfony/debug": "^4.3|^5",
+ "symfony/finder": "^4.3|^5"
+ },
+ "require-dev": {
+ "mockery/mockery": "^1.3.3",
+ "orchestra/testbench-dusk": "^4|^5|^6",
+ "phpunit/phpunit": "^8.5|^9.0",
+ "squizlabs/php_codesniffer": "^3.5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.5-dev"
+ },
+ "laravel": {
+ "providers": [
+ "Barryvdh\\Debugbar\\ServiceProvider"
+ ],
+ "aliases": {
+ "Debugbar": "Barryvdh\\Debugbar\\Facade"
+ }
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Barryvdh\\Debugbar\\": "src/"
+ },
+ "files": [
+ "src/helpers.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Barry vd. Heuvel",
+ "email": "barryvdh@gmail.com"
+ }
+ ],
+ "description": "PHP Debugbar integration for Laravel",
+ "keywords": [
+ "debug",
+ "debugbar",
+ "laravel",
+ "profiler",
+ "webprofiler"
+ ],
+ "support": {
+ "issues": "https://github.com/barryvdh/laravel-debugbar/issues",
+ "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.6.2"
+ },
+ "funding": [
+ {
+ "url": "https://fruitcake.nl",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/barryvdh",
+ "type": "github"
+ }
+ ],
+ "time": "2021-06-14T14:29:26+00:00"
+ },
{
"name": "brick/math",
"version": "0.9.3",
],
"time": "2021-01-18T20:58:21+00:00"
},
+ {
+ "name": "maximebf/debugbar",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/maximebf/php-debugbar.git",
+ "reference": "0a3532556be0145603f8a9de23e76dc28eed7054"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/0a3532556be0145603f8a9de23e76dc28eed7054",
+ "reference": "0a3532556be0145603f8a9de23e76dc28eed7054",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1|^8",
+ "psr/log": "^1.0",
+ "symfony/var-dumper": "^2.6|^3|^4|^5"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^7.5.20 || ^9.4.2"
+ },
+ "suggest": {
+ "kriswallsmith/assetic": "The best way to manage assets",
+ "monolog/monolog": "Log using Monolog",
+ "predis/predis": "Redis storage"
+ },
+ "default-branch": true,
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.17-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "DebugBar\\": "src/DebugBar/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Maxime Bouroumeau-Fuseau",
+ "email": "maxime.bouroumeau@gmail.com",
+ "homepage": "http://maximebf.com"
+ },
+ {
+ "name": "Barry vd. Heuvel",
+ "email": "barryvdh@gmail.com"
+ }
+ ],
+ "description": "Debug bar in the browser for php application",
+ "homepage": "https://github.com/maximebf/php-debugbar",
+ "keywords": [
+ "debug",
+ "debugbar"
+ ],
+ "support": {
+ "issues": "https://github.com/maximebf/php-debugbar/issues",
+ "source": "https://github.com/maximebf/php-debugbar/tree/v1.17.1"
+ },
+ "time": "2021-08-01T09:19:02+00:00"
+ },
{
"name": "monolog/monolog",
"version": "dev-main",
],
"time": "2021-08-17T15:35:52+00:00"
},
+ {
+ "name": "symfony/debug",
+ "version": "4.4.x-dev",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/debug.git",
+ "reference": "2f9160e92eb64c95da7368c867b663a8e34e980c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/2f9160e92eb64c95da7368c867b663a8e34e980c",
+ "reference": "2f9160e92eb64c95da7368c867b663a8e34e980c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1.3",
+ "psr/log": "^1|^2|^3"
+ },
+ "conflict": {
+ "symfony/http-kernel": "<3.4"
+ },
+ "require-dev": {
+ "symfony/http-kernel": "^3.4|^4.0|^5.0"
+ },
+ "default-branch": true,
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Debug\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides tools to ease debugging PHP code",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/debug/tree/v4.4.27"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2021-07-22T07:21:39+00:00"
+ },
{
"name": "symfony/deprecation-contracts",
"version": "dev-main",
"ext-dom": "*",
"ext-simplexml": "*",
"ext-json": "*",
- "ext-iconv": "*"
+ "ext-iconv": "*",
+ "ext-gd": "*"
},
"platform-dev": [],
"plugin-api-version": "2.1.0"
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
-use Illuminate\Contracts\Queue;
use Cubist\Util\CommandLine;
public function handle()
{
+ start_measure('Process page ' . $this->page);
foreach ($this->files as $file) {
$this->getFile($this->page, $file['format'], $file['resolution'], $file['withText'], $file['withGraphics'], 'html', false);
}
+ stop_measure('Process page ' . $this->page);
}
$dir = rtrim($this->out . $version, '/') . '/';
$minsize = 1;
+ $file = '';
if ($format === 'svg') {
$prefix = $withGraphics ? 'f' : 't';
$file = $dir . $prefix . 'o' . $page;
unlink($lock);
}
+ public function getResolutionRatio()
+ {
+ return $this->document->getResolutionRatio();
+ }
+
+ public function getMobileFirstRatio()
+ {
+ return $this->document->getMobileFirstRatio();
+ }
+
public function makeSVGFile($page, $force = false)
{
$svgFile = $this->out . '/html/fp' . $page . '.svg';
public function makeOptimizedSVGFile($page, $resolution, $out)
{
$in = $this->makeSVGFile($page);
- wsTools::optimizeSVGImages($in, $out, $resolution);
- wsTools::optimizeSVG($out, $out);
+ SVGTools::optimizeSVGImages($in, $out, $resolution);
+ SVGTools::optimizeSVG($out, $out);
}
protected function getSplittedPDFPage($page)
public function splitDoc()
{
- $this->addToLog('Split document');
- if (!file_exists($this->out . '/pdf')) {
- mkdir($this->out . '/pdf');
+ start_measure('Split PDF');
+
+ if (!file_exists($this->out . '/pdf') && !mkdir($concurrentDirectory = $this->out . '/pdf') && !is_dir($concurrentDirectory)) {
+ throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
}
- $pdftk = new cubeCommandLine('pdftk');
- $pdftk->setPath(CONVERTER_PATH);
- $pdftk->setArg(null, $this->getCroppedPDF());
+ $pdftk = new CommandLine('pdftk');
+ $pdftk->setArg(null, $this->getPDFInput());
$pdftk->setArg(null, 'burst');
$pdftk->setArg(null, 'uncompress');
$pdftk->setArg(null, 'output');
$pdftk->setArg(null, $this->out . 'pdf/p%d.pdf');
$pdftk->execute();
- $this->addToLog($pdftk);
+
for ($i = 1; $i <= $this->getPagesNumber(); $i++) {
// Remove annotations : https://gist.github.com/stefanschmidt/5248592
}
}
}
+ stop_measure('Split PDF');
+ }
+
+ /**
+ * @return int
+ */
+ public function getPagesNumber()
+ {
+ return $this->document->getPages();
+ }
+
+ public function getPDFInput()
+ {
+ return $this->document->getPDFInput();
}
}
}
$fwstk = new CommandLine(FluidbookTools::tools_path('fwstk.sh'));
- $fwstk->setArg('--input ' . $this->in);
+ $fwstk->setArg('--input ' . $this->getPDFInput());
$fwstk->setArg('--infos');
$fwstk->execute();
/**
* @param $dest string
*/
- public function processPages($dest, $files)
+ public function processPages($dest, $files, $sync = false)
{
for ($i = 1; $i <= $this->getPages(); $i++) {
- $this->processPage($i, $dest, $files);
+ $this->processPage($i, $dest, $files, $sync);
}
}
* @param $i
* @param $dest
*/
- public function processPage($page, $dest, $files)
+ public function processPage($page, $dest, $files, $sync = false)
{
- dispatch(new ProcessPage($this, $page, $dest, $files));
+ $dispatchFunction = $sync ? 'dispatchSync' : 'dispatch';
+ ProcessPage::$dispatchFunction($this, $page, $dest, $files);
+ }
+
+ public function getResolutionRatio()
+ {
+ $a4surface = 500990; // en pt²
+ $docSurface = $this->getWidth() * $this->getHeight(); // en pt²
+ // to have the same surface resulting in px, we have to sqrt the ratio between the two surfaces defined above
+ return sqrt($a4surface / $docSurface);
+ }
+
+ public function getMobileFirstRatio()
+ {
+ return 620 / $this->getWidth();
+ }
+
+ public function getPDFInput()
+ {
+ return $this->in;
}
}