Files
Nexora/app/Livewire/PdfViewer.php

38 lines
757 B
PHP
Raw Normal View History

2025-05-23 00:26:53 +02:00
<?php
namespace App\Livewire;
use Illuminate\Support\Facades\Storage;
use Livewire\Component;
class PdfViewer extends Component
{
public $pdfUrl;
public $currentPage = 1;
public $totalPages = 1;
public $zoomLevel = 1;
protected $listeners = ['pageChanged', 'annotationSaved'];
public function mount($pdfId)
{
$this->pdfUrl = Storage::disk('pdfs')->temporaryUrl($pdfId, now()->addMinutes(30));
}
public function pageChanged($page)
{
$this->currentPage = $page;
}
public function annotationSaved($data)
{
// Procesar y guardar anotaciones
$this->emit('refreshAnnotations');
}
public function render()
{
return view('livewire.pdf-viewer');
}
}