diff --git a/app/Console/ConvertHtmlToPdf.php b/app/Console/ConvertHtmlToPdf.php
new file mode 100644
index 0000000..3b87201
--- /dev/null
+++ b/app/Console/ConvertHtmlToPdf.php
@@ -0,0 +1,48 @@
+argument('directory');
+
+ $this->info('Starting HTML to PDF conversion process...');
+
+ // Dispatch the job
+ ConvertHtmlToPdfJob::dispatch($directory);
+
+ $this->info('HTML to PDF conversion job has been queued.');
+
+ return 0;
+ } catch (Exception $e) {
+ $this->error('Error processing HTML to PDF conversion: ' . $e->getMessage());
+ return 1;
+ }
+ }
+}
diff --git a/app/Jobs/ConvertHtmlToPdfJob.php b/app/Jobs/ConvertHtmlToPdfJob.php
new file mode 100644
index 0000000..1fa5dc5
--- /dev/null
+++ b/app/Jobs/ConvertHtmlToPdfJob.php
@@ -0,0 +1,102 @@
+baseDirectory = $baseDirectory;
+ }
+
+ /**
+ * Execute the job.
+ */
+ public function handle(): void
+ {
+ try {
+ Log::info("Starting HTML to PDF conversion in directory: {$this->baseDirectory}");
+
+ // Check if directory exists
+ if (!File::isDirectory($this->baseDirectory)) {
+ Log::error("Directory not found: {$this->baseDirectory}");
+ return;
+ }
+
+ // Get all subdirectories (ID folders)
+ $idDirectories = File::directories($this->baseDirectory);
+
+ foreach ($idDirectories as $idDirectory) {
+ $this->processDirectory($idDirectory);
+ }
+
+ Log::info("HTML to PDF conversion completed successfully.");
+ } catch (Exception $e) {
+ Log::error("Error converting HTML to PDF: " . $e->getMessage());
+ }
+ }
+
+ /**
+ * Process a single ID directory
+ *
+ * @param string $directory Directory path to process
+ */
+ protected function processDirectory(string $directory): void
+ {
+ try {
+ $htmlFiles = File::glob($directory . '/*.html');
+
+ foreach ($htmlFiles as $htmlFile) {
+ $this->convertHtmlToPdf($htmlFile);
+ }
+ } catch (Exception $e) {
+ Log::error("Error processing directory {$directory}: " . $e->getMessage());
+ }
+ }
+
+ /**
+ * Convert a single HTML file to PDF
+ *
+ * @param string $htmlFilePath Path to HTML file
+ */
+ protected function convertHtmlToPdf(string $htmlFilePath): void
+ {
+ try {
+ $filename = pathinfo($htmlFilePath, PATHINFO_FILENAME);
+ $directory = pathinfo($htmlFilePath, PATHINFO_DIRNAME);
+ $pdfFilePath = $directory . '/' . $filename . '.pdf';
+
+ // Read HTML content
+ $htmlContent = File::get($htmlFilePath);
+
+ // Convert HTML to PDF
+ $pdf = PDF::loadHTML($htmlContent);
+
+ // Save PDF file
+ $pdf->save($pdfFilePath);
+
+ Log::info("Converted {$htmlFilePath} to {$pdfFilePath}");
+ } catch (Exception $e) {
+ Log::error("Error converting {$htmlFilePath} to PDF: " . $e->getMessage());
+ }
+ }
+}