diff --git a/app/Http/Controllers/Api/Core/convertController.php b/app/Http/Controllers/Api/Core/convertController.php index 7b0ea0e6..b3e3d753 100644 --- a/app/Http/Controllers/Api/Core/convertController.php +++ b/app/Http/Controllers/Api/Core/convertController.php @@ -120,9 +120,11 @@ public function convert(Request $request) { $fileSize = filesize($newFilePath); $newFileSize = AppHelper::instance()->convert($fileSize, "MB"); $procUuid = AppHelper::Instance()->generateUniqueUuid(cnvModel::class, 'processId'); - $pdf = new Pdf($newFilePath); - $pdfTotalPages = $pdf->pageCount(); $pdfNameWithExtension = pathinfo($currentFileName, PATHINFO_EXTENSION); + if ($pdfNameWithExtension == "pdf") { + $pdf = new Pdf($newFilePath); + $pdfTotalPages = $pdf->pageCount(); + } appLogModel::create([ 'processId' => $procUuid, 'groupId' => $batchId,