Revamp streaming PDF reader to render pages on demand (#2332)

Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
ACX
2026-01-18 22:38:19 -07:00
committed by GitHub
co-authored by acx10
parent d4cd6f52f4
commit a39043c2a0
37 changed files with 1266 additions and 413 deletions
@@ -3,6 +3,22 @@ import {API_CONFIG} from '../../../core/config/api-config';
import {HttpClient} from '@angular/common/http';
import {AuthService} from '../../../shared/service/auth.service';
export interface PdfInfoPage {
pageNumber: number;
displayName: string;
}
export interface PdfOutlineItem {
title: string;
pageNumber: number;
children: PdfOutlineItem[] | null;
}
export interface PdfInfo {
pageCount: number;
outline: PdfOutlineItem[] | null;
}
@Injectable({
providedIn: 'root'
})
@@ -26,6 +42,10 @@ export class NewPdfReaderService {
return this.http.get<number[]>(this.appendToken(`${this.pagesUrl}/${bookId}/pages`));
}
getPageInfo(bookId: number) {
return this.http.get<PdfInfo>(this.appendToken(`${this.pagesUrl}/${bookId}/info`));
}
getPageImageUrl(bookId: number, page: number): string {
return this.appendToken(`${this.imageUrl}/${bookId}/pdf/pages/${page}`);
}