Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing page size (width and height) to the OnLoadCompleteListener #743

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}