 Path = require "path"
 spawn = require("child_process").spawn
 logger = require "logger-sharelatex"
+Metrics = require "./Metrics"
 _ = require "underscore"
 
 module.exports = OutputFileOptimiser =

		args = ["--linearize", src, tmpOutput]
		logger.log args: args, "running qpdf command"

		proc = spawn("qpdf", args)
		stdout = ""
		proc.stdout.on "data", (chunk) ->

			logger.warn {err, args}, "qpdf failed"
			callback(null) # ignore the error
		proc.on "close", (code) ->
			timer.done()
			if code != 0
				logger.warn {code, args}, "qpdf returned error"
				return callback(null) # ignore the error
