Skip to content

Settings ​

The service can be configured via the settings API or by editing data/settings.json.

Settings Schema ​

json
{
  "browser": {
    "maxConcurrent": 3,
    "defaultTimeout": 30000,
    "defaultViewport": { "width": 1920, "height": 1080 },
    "launchOptions": {
      "headless": true,
      "args": ["--no-sandbox", "--disable-setuid-sandbox"]
    }
  },
  "pdf": {
    "defaultFormat": "A4",
    "defaultMargin": {
      "top": "20mm",
      "right": "20mm",
      "bottom": "20mm",
      "left": "20mm"
    },
    "printBackground": true
  },
  "queue": {
    "maxSize": 100,
    "processingTimeout": 60000,
    "retryAttempts": 2,
    "retryDelay": 1000
  },
  "storage": {
    "outputDir": "pdf-files",
    "cleanupAfterHours": 24
  }
}

Browser Settings ​

SettingTypeDefaultDescription
maxConcurrentnumber3Maximum concurrent browser instances
defaultTimeoutnumber30000Default navigation timeout (ms)
defaultViewportobject{ width: 1920, height: 1080 }Default viewport size
launchOptionsobject-Chromium launch options

PDF Settings ​

SettingTypeDefaultDescription
defaultFormatstring"A4"Default paper format
defaultMarginobject20mm all sidesDefault margins
printBackgroundbooleantruePrint background by default

Queue Settings ​

SettingTypeDefaultDescription
maxSizenumber100Maximum queue size
processingTimeoutnumber60000Job timeout (ms)
retryAttemptsnumber2Retry attempts on failure
retryDelaynumber1000Delay between retries (ms)

Storage Settings ​

SettingTypeDefaultDescription
outputDirstring"pdf-files"PDF output directory
cleanupAfterHoursnumber24Auto-cleanup after hours

API ​

Get Settings ​

bash
GET /api/settings

Update Settings ​

bash
PUT /api/settings
Content-Type: application/json

{
  "browser": {
    "maxConcurrent": 5
  }
}

Reset to Defaults ​

bash
POST /api/settings/reset

Released under the MIT License.