mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
#68 PDFJS Mock and test
This commit is contained in:
@@ -41,9 +41,9 @@ export class ViewerComponent {
|
||||
ngOnInit() {
|
||||
console.log('urlFile ' + this.urlFile);
|
||||
|
||||
this.nameFile = PDFJS.getFilenameFromUrl(this.urlFile);
|
||||
this.nameFile = this.getPDFJS().getFilenameFromUrl(this.urlFile);
|
||||
|
||||
PDFJS.getDocument(this.urlFile).then((pdf) => {
|
||||
return this.getPDFJS().getDocument(this.urlFile).then((pdf) => {
|
||||
this.currentPdf = pdf;
|
||||
this.totalPages = pdf.numPages;
|
||||
this.currentPage = 1;
|
||||
@@ -52,6 +52,10 @@ export class ViewerComponent {
|
||||
});
|
||||
}
|
||||
|
||||
getPDFJS() {
|
||||
return PDFJS;
|
||||
}
|
||||
|
||||
loadPage(pdf: any, numberPage: number) {
|
||||
pdf.getPage(numberPage).then((page) => {
|
||||
|
||||
@@ -59,7 +63,6 @@ export class ViewerComponent {
|
||||
|
||||
let scale = 1.5;
|
||||
let viewport = page.getViewport(scale);
|
||||
|
||||
let canvas: any = document.getElementById('viewer-the-canvas');
|
||||
|
||||
if (canvas) {
|
||||
|
Reference in New Issue
Block a user