Route::match(['get'], $segment . '/docInfos/{doc_id}', $controller . '@docInfos');
Route::match(['get'], $segment . '/{fluidbook_id}/pdfarchive/{time}', $controller . '@pdfArchive');
Route::match(['get'], $segment . '/{fluidbook_id}/{type}/{page}.{ext}', $controller . '@getPageAsset')
- ->whereIn('type', ['originalpdf', 'texts', 'index', 'layout', 'links']);
+ ->whereIn('type', ['originalpdf', 'texts', 'index', 'layout', 'links', 'accessible']);
}
protected function setupCompositionDefaults()
$file = $fb->getLinksFile($page);
return XSendFileController::sendfile($file, headers: ['Content-type', 'text/plain']);
}
+ if ($type === 'accessible') {
+ $file = $fb->getAccessibleFile($page, $ext);
+ return XSendFileController::sendfile($file, headers: ['Content-type', Files::getMimeType($file)]);
+ }
$types = ['texts' => FluidbookDocument::TEXT_PLAIN, 'index' => FluidbookDocument::TEXT_INDEX, 'layout' => FluidbookDocument::TEXT_LAYOUT];
if (!isset($types[$type])) {
abort(404, 'Text type not found');
$this->splitPDF();
$this->updateProgression($uploadID, __('Extraction des textes'), 1.6);
$this->extractTexts();
- $this->updateProgression($uploadID, __('Extraction du HTML'), 1.75);
- $this->extractMarkdown();
$this->updateProgression($uploadID, __('Extraction des liens'), 1.9);
$this->extractLinks();
$this->updateProgression($uploadID, __('Conversion des pages'), 2);
}
}
+ public function getMarkdown($page)
+ {
+ if (!file_exists($this->path('docling/p1.md'))) {
+ $this->extractMarkdown();
+ }
+ return $this->path('docling/p' . $page . '.md');
+ }
+
public function echoStatus($id)
{
if (!$this->processSync) {
return self::_getDocument($compo[0])->getHightlightFile($compo[1], $this->search_mode ?: 'standard', $this->ignoreSearchSeparators);
}
+ public function getAccessibleFile($page,$format='md'){
+ $compo = $this->getComposition()[$page];
+ return self::_getDocument($compo[0])->getMarkdown($compo[1]);
+ }
+
public function getPDFSplitSource($page)
{
if ($page > $this->getPagesNumber()) {