private void GeneratePdfInternal(IInputData[] inputFiles, IOutputData output, string coverHtml, RocketPDFParameterManager parameterManager)
        {
            TempFileManager tempFileManager = new TempFileManager(tempFilesDirectory: TempFilesDirectory, filePrefix: "pdf-temp-");

            OutputFileProvider outputFileProvider = new OutputFileProvider(tempFileManager);

            var            outputPdfFilePath = output.Accept(outputFileProvider).OutputFile;
            ResultProvider resultProvider    = new ResultProvider(outputPdfFilePath);


            var parameters            = parameterManager.GetParameters();
            var pdfParametersInternal = GenerateInternalParameters(inputFiles, outputPdfFilePath, coverHtml, parameters, tempFileManager);

            try
            {
                if (_batchMode)
                {
                    InvokeWkHtmlToPdfInInBatch(parameters, pdfParametersInternal);
                }
                else
                {
                    InvokeWkHtmlToPdf(parameters, pdfParametersInternal);
                }

                output.Accept(resultProvider);
            }
            catch (Exception ex)
            {
                if (!_batchMode)
                {
                    _processHelper.EnsureWkHtmlProcessStopped();
                }
                throw new Exception("Can't generate PDF: " + ex.Message, ex);
            }
            finally
            {
                tempFileManager.DeleteTempFiles();
            }
        }