define('WMARKTEXT', 'BORRADOR');
 }
 $myPath = dirname(__FILE__);
 $myUrl = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
 $myPath = substr($myPath, 0, strpos($myPath, 'wp-content') + 11);
 $myUrl = substr($myUrl, 0, strpos($myUrl, 'wp-content') + 11);
 if (!defined('CONTENTPATH')) {
     define('CONTENTPATH', $myPath);
 }
 if (!defined('CONTENTURL')) {
     define('CONTENTURL', $myUrl);
 }
 $accion = isset($_POST['accion']) ? $_POST['accion'] : NULL;
 $idDocumento = isset($_POST['docId']) ? $_POST['docId'] : NULL;
 include_once WP_CONTENT_DIR . "/themes/twentyeleven-child/mpdf/mpdf.php";
 $documento = Datos::getDocumentoData($idDocumento);
 if ($documento === false) {
     echo 'ERROR AL OBTENER DATOS DEL DOCUMENTO!!!<br/>';
 }
 // Hallamos las páginas
 $tPaginas = Datos::getPaginas($idDocumento);
 // Lo metemos en un temporal para ordenar después
 if ($paginas === false) {
     echo '<div class="panel-error">Error al obtener las paacute;ginas del documento ' . $idDocumento . '</div>';
 }
 if (!is_array($tPaginas)) {
     echo '<div class="panel-alert">No hay p&aacute;ginas para el documento ' . $idDocumento . '</div>';
 } else {
     $portada = NULL;
     $contraportada = NULL;
     $paginas = NULL;