Create a new optimization profile

PUT http://{host}:{port}/qoppapdf/v1/optimize-profiles/myprofile
(sample JSON in message body)
{
  "discardAnnotations" : true,
  "discardUnusedResources" : true,
  "mergeDuplicateFonts" : true,
  "mergeDuplicateImages" : true,
  "compressObjectsIntoStreams" : true,
  "colorImageHandler": {
    "colorSpace": 1,
    "compression": 1,
    "dpi": 150,
    "jpegQuality": 0.8
  },
  "grayImageHandler": {
    "colorSpace": 1,
    "compression": 1,
    "dpi": 150,
    "jpegQuality": 0.7
  },
  "bwImageHandler": {
    "colorSpace": 2,
    "compression": 2,
    "dpi": 150,
    "jpegQuality": 0.6
  }
}

Optimize a PDF using a predefined profile

POST http://{host}:{port}/qoppapdf/v1/documents/mydir/mydoc.pdf
(sample JSON in message body)
{
  "OptimizeAction": {
    "profileName": "myprofile",
    "savePath": "optimized/mydoc.pdf"
  }
}