Skip to content

Commit

Permalink
pdf: fix getAnnotations issue
Browse files Browse the repository at this point in the history
Failed to render 10.1007/978-3-662-54809-7 otherwise.
Could fix it quickly thanks to mozilla/pdf.js#8429.
  • Loading branch information
andrenarchy committed Oct 22, 2017
1 parent aeec165 commit 3f344d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/directives/pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export default function(app) {
});

if (!this.annotations) {
this.annotations = await this.page.getAnnotations();
this.annotations = await this.page.getAnnotations({intent: 'display'});
}

// wipe all children from the container
Expand Down
6 changes: 5 additions & 1 deletion types/pdfjs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,17 @@ interface PDFAnnotationLayerParameters {
update(params: PDFAnnotationLayerParameters): void;
}

interface PDFGetAnnotationsParameters {
intent?: 'display' | 'print';
}

interface PDFPageProxy {
pageNumber: number;
rotate: number;
ref: PDFRef;
view: number[];
getViewport(scale: number, rotate?: number): PDFPageViewport;
getAnnotations(): PDFPromise<PDFAnnotations>;
getAnnotations(params: PDFGetAnnotationsParameters?): PDFPromise<PDFAnnotations>;
render(params: PDFRenderParams): PDFRenderTask;
getTextContent(): PDFPromise<PDFTextContent>;
// getOperationList(): PDFPromise<>;
Expand Down

0 comments on commit 3f344d2

Please sign in to comment.