-
-
Save parzibyte/6582c078fb3dc0f9643e85f5171ee612 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Incluir autoload | |
include "vendor/autoload.php"; | |
$parseador = new \Smalot\PdfParser\Parser(); | |
$nombreDocumento = "6-imagenes.pdf"; | |
$documento = $parseador->parseFile($nombreDocumento); | |
$imagenes = $documento->getObjectsByType('XObject', 'Image'); | |
$contador = 0; # Un índice | |
foreach ($imagenes as $imagen) { | |
file_put_contents(sprintf("Imagen_%02d.jpg", $contador + 1), $imagen->getContent()); | |
$contador++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment