Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Pdf Optimizer Laravel Package

mostafaznv/pdf-optimizer

Optimize and compress PDFs in PHP or Laravel using Ghostscript. Fluent, chainable API with rich options, logging, and customization. Laravel-friendly inputs (paths, uploads, disks) plus queue support for async optimization.

View on GitHub
Deep Wiki
Context7

Logger

Integrate a custom logger into the pdf-optimizer package using the logger method. This empowers you to capture detailed logs and gain insights into the optimization process, aiding in debugging and monitoring.

A logger, is a class that implements Psr\Log\LoggerInterface, utilized for logging activities. A recommended logging library that fully complies with this interface is Monolog. The pdf-optimizer package utilizes the logger to record information such as the Optimizers used, executed commands, and their respective outputs in the log files.

{% tabs %} {% tab title="Standalone PHP" %}

use App\Logger;
use Mostafaznv\PdfOptimizer\PdfOptimizer;

$logger = new Logger;

PdfOptimizer::init()->logger($logger)->optimize('input.pdf', 'output.pdf');

{% endtab %}

{% tab title="Laravel" %}

use App\Logger;
use Mostafaznv\PdfOptimizer\Laravel\Facade\PdfOptimizer;

PdfOptimizer::open('input-1.pdf')
    ->logger(new Logger)
    ->optimize('output-1.pdf');

{% endtab %} {% endtabs %}

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
iio/libmergepdf
redaxo/project
zatona-eg/zatona-eg-api
patrickbussmann/oauth2-apple
3brs/enterprise-security-bundle
ardenexal/fhir-models
ardenexal/fhir-validation
dpfx/laravel-livewire-wizards
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle
dmstr/api-platform-utils-bundle
dmstr/api-configuration-bundle
chrisdev/ux-components
crudly/encrypted
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony