Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created June 17, 2019 02:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/2748af5b0048619496523ed570b538bb to your computer and use it in GitHub Desktop.
Save parzibyte/2748af5b0048619496523ed570b538bb to your computer and use it in GitHub Desktop.
<?php
# Incluir autoload
include "vendor/autoload.php";
$parseador = new \Smalot\PdfParser\Parser();
$documentos = [
"2.1-textoEstilo.pdf",
"Ensayo.pdf",
"6-imagenes.pdf",
];
foreach ($documentos as $documento) {
printf("<h1>Documento %s</h1>", $documento);
$documento = $parseador->parseFile($documento);
$paginas = $documento->getPages();
foreach ($paginas as $indice => $pagina) {
printf("<h2>Página #%02d</h2>", $indice + 1);
$texto = $pagina->getText();
echo "<pre>";
echo $texto;
echo "</pre>";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment