Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Bounding rectangle of a page

More
11 years 7 months ago - 11 years 7 months ago #8463 by alexander.gustke
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
Last edit: 11 years 7 months ago by alexander.gustke.
More
11 years 7 months ago #8476 by nermeen
Which version are you using, and which view mode?
More
11 years 7 months ago #8478 by alexander.gustke
i managed it by myself - thank you:
Code:
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}; }
More
11 years 7 months ago #8483 by radaee
Replied by radaee on topic Bounding rectangle of a page
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();
Time to create page: 0.393 seconds
Powered by Kunena Forum