- Posts: 11
- Thank you received: 1
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
- alexander.gustke
- Topic Author
- Offline
- New Member
-
Less
More
11 years 7 months ago - 11 years 7 months ago #8463
by alexander.gustke
Bounding rectangle of a page was created 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
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.
11 years 7 months ago #8476
by nermeen
Replied by nermeen on topic Bounding rectangle of a page
Which version are you using, and which view mode?
- alexander.gustke
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 11
- Thank you received: 1
11 years 7 months ago #8478
by alexander.gustke
Replied by alexander.gustke on topic Bounding rectangle of a page
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};
}
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();
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