Bounding rectangle of a page - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC: Bounding rectangle of a page

Bounding rectangle of a page 4 years 7 months ago #8463

  • alexander.gustke
  • alexander.gustke's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 11
  • Thank you received: 1
Hello,

how do i get the bounding rectangle of a visible page. Below my visible page is blank space and i need to determine how much is it (parentHeigth - pageHeight). I need this information to crop my visible bounding boxes (of the annotations) if i am going to shift them to the borders.

Thanks

Please Log in or Create an account to join the conversation.

Last edit: by alexander.gustke.

Bounding rectangle of a page 4 years 7 months ago #8476

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 870
  • Karma: 23
  • Thank you received: 71
Which version are you using, and which view mode?

Please Log in or Create an account to join the conversation.

Bounding rectangle of a page 4 years 7 months ago #8478

  • alexander.gustke
  • alexander.gustke's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 11
  • Thank you received: 1
i managed it by myself - thank you:
private float[] getBoundingRectangle() {
        int[] l = new int[2];

        getLocationOnScreen(l);
        PDFVPage pdfvPage = pdfView.vGetPage(currentPageNo);

        PDFView.PDFPos upLeft = pdfView.vGetPos(0, 0);

        int x = (int) (pdfView.vGetScale() * upLeft.x);
        int y = (int) (pdfView.vGetScale() * upLeft.y);

        int w = pdfvPage.GetWidth();
        int h = pdfvPage.GetHeight();

        return new float[]{-x, -(h - y), w - x, y};
    }

Please Log in or Create an account to join the conversation.

Bounding rectangle of a page 4 years 7 months ago #8483

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 886
  • Karma: 43
  • Thank you received: 16
to get bounding box on screen:
PDFVPage vpage = PDFView.vGetPage(pageno);
int left = vpage.GetVX(PDFView.vGetX());
int top = vpage.GetVY(PDFView.vGetY());
int width = vpage.GetWidth();
int height = vpage.GetHeight();
The following user(s) said Thank You: alexander.gustke

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum