diff --git a/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/PDFView.java b/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/PDFView.java index 5e9636e7..28b026f8 100644 --- a/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/PDFView.java +++ b/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/PDFView.java @@ -734,8 +734,8 @@ void loadComplete(PdfFile pdfFile) { } dragPinchManager.enable(); - - callbacks.callOnLoadComplete(pdfFile.getPagesCount()); + SizeF size = pdfFile.getPageSize(defaultPage); + callbacks.callOnLoadComplete(pdfFile.getPagesCount(), size.getWidth(), size.getHeight()); jumpTo(defaultPage, false); } diff --git a/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/listener/Callbacks.java b/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/listener/Callbacks.java index 09becb1c..0d233d9c 100644 --- a/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/listener/Callbacks.java +++ b/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/listener/Callbacks.java @@ -78,9 +78,9 @@ public void setOnLoadComplete(OnLoadCompleteListener onLoadCompleteListener) { this.onLoadCompleteListener = onLoadCompleteListener; } - public void callOnLoadComplete(int pagesCount) { + public void callOnLoadComplete(int pagesCount, float pageWidth, float pageHeight) { if (onLoadCompleteListener != null) { - onLoadCompleteListener.loadComplete(pagesCount); + onLoadCompleteListener.loadComplete(pagesCount, pageWidth, pageHeight); } } diff --git a/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/listener/OnLoadCompleteListener.java b/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/listener/OnLoadCompleteListener.java index c319fc58..f8726811 100644 --- a/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/listener/OnLoadCompleteListener.java +++ b/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/listener/OnLoadCompleteListener.java @@ -25,5 +25,5 @@ public interface OnLoadCompleteListener { * Called when the PDF is loaded * @param nbPages the number of pages in this PDF file */ - void loadComplete(int nbPages); + void loadComplete(int nbPages, float pageWidth, float pageHeight); }