PDF Optimizer
  • 🏁Getting Started
    • Introduction
    • Installation
    • Support Us
    • License
  • 🚀Basic Usage
    • Standalone PHP
    • Laravel
  • ⚙️Advanced Usage
    • Ghostscript Binary Configuration
    • Timeout
    • Logger
    • Custom Ghostscript Options
    • Export Script
    • Configuring Ghostscript
      • ASCII85EncodePages
      • AutoFilterColorImages
      • AutoFilterGrayImages
      • AutoRotatePages
      • ColorConversionStrategy
      • ColorImageDepth
      • ColorImageFilter
      • ColorImageDownsampleThreshold
      • ColorImageDownsampleType
      • ColorImageResolution
      • CompatibilityLevel
      • CompressFonts
      • CompressPages
      • ConvertCMYKImagesToRGB
      • DefaultRenderingIntent
      • DetectDuplicateImages
      • DownsampleColorImages
      • DownsampleGrayImages
      • DownsampleMonoImages
      • EmbedAllFonts
      • EncodeColorImages
      • EncodeGrayImages
      • EncodeMonoImages
      • FastWebView
      • GrayImageDepth
      • GrayImageDownsampleThreshold
      • GrayImageDownsampleType
      • GrayImageFilter
      • GrayImageResolution
      • LockDistillerParams
      • MaxInlineImageSize
      • MaxSubsetPct
      • MonoImageDepth
      • MonoImageDownsampleThreshold
      • MonoImageDownsampleType
      • MonoImageFilter
      • MonoImageResolution
      • PassThroughJPEGImages
      • PassThroughJPXImages
      • ParseDSCComments
      • ParseDSCCommentsForDocInfo
      • PDFA
      • PDFACompatibilityPolicy
      • PDFX
      • PreserveEPSInfo
      • PreserveHalftoneInfo
      • PreserveMarkedContent
      • PreserveOPIComments
      • PreserveOverprintSettings
      • ProcessColorModel
      • PDFSETTINGS
      • SubsetFonts
      • UCRandBGInfo
      • UseFlateCompression
  • 🎮Laravel Deep Dive
    • Filesystem
    • Queue
Powered by GitBook
On this page

Was this helpful?

  1. Advanced Usage

Timeout

Customize the timeout setting to exert control over the duration of the optimization process, allowing you to fine-tune the time allocated for the operation based on the specific requirements of your application or environment.

By default processes have a timeout of 300 seconds, however you can change it passing a different timeout (in seconds) to the setTimeout method:

use Mostafaznv\PdfOptimizer\PdfOptimizer;

PdfOptimizer::init()->setTimeout(500)->optimize('input.pdf, 'output.pdf');

By default, processes have a timeout of 300 seconds, which is set by config('pdf-optimizer.timeout'). However, you can modify this timeout by passing a different duration (in seconds) to the setTimeout method:

use Mostafaznv\PdfOptimizer\Laravel\Facade\PdfOptimizer;

PdfOptimizer::open('input-1.pdf')
    ->setTimeout(500)
    ->optimize('output-1.pdf');

PreviousGhostscript Binary ConfigurationNextLogger

Last updated 1 year ago

Was this helpful?

⚙️