mejoras
This commit is contained in:
37
app/Livewire/PdfViewer.php
Normal file
37
app/Livewire/PdfViewer.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user