How to add a Button/view above on PdfViewCtrl overlayview?

Product:Android PDFTronSDK

Product Version:Demo

Please give a brief summary of your issue:How to add a Button/view above on PdfViewCtrl overlayview?
(Think of this as an email subject)

I am trying to add a view above on PdfViewCtrl. View is not visible.
Here is the code sample,

val view = View(requireContext())
val pagePos = mPdfViewCtrl!!.convScreenPtToPagePt(point.x, point.y)
view.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.red))
val param = LinearLayout.LayoutParams(100,100)
view.layoutParams = param
view.x = pagePos[0].toFloat()
view.y = pagePos[1].toFloat()
mPdfViewCtrl!!.addView(view)

Please help what i need to make correction?
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)

Please provide a link to a minimal sample where the issue is reproducible:

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi

I have tried without any position & opted for Gravity centre. I am failing to add view over PsdViewCtrl class.

Any help, how could i resolve this?

Thank you.

Hi Manoj,

Thanks for contacting us.
Could you please try the following guide for adding a custom relative layout?
https://www.pdftron.com/documentation/android/guides/advanced/custom-relative-layout/

Also, a sample is available at this repository:
https://github.com/PDFTron/pdftron-android-samples/blob/04ee6c3bc517f17ed2bd01f99741d5126173a8f4/CustomUI/app/src/main/java/com/pdftron/android/tutorial/customui/custom/CustomLinkClick.java#L96-L100

Could you please give it a try?

Best regards,
Saeed