Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about iOS development and PDF

Add a button on top side corner of the pdf page.

More
9 years 1 month ago #11842 by Rajat Singla
Hii.

Can we add a button on the top side corner of the pdfPage.
if yes, then how?

Thanks.
More
9 years 1 month ago #11844 by emanuele
Hi,

you can consider the pdf page like a normal view and add objects with standard development methods.
More
9 years 1 month ago - 9 years 1 month ago #11845 by Rajat Singla
Hii, thanks for the reply.

I tried that, but when i need to add button where the page starts.

Please look at the attachment below.

I need to add the button at position 2.
But using above approach, button is set at posiiton 1.
Last edit: 9 years 1 month ago by Rajat Singla.
More
9 years 1 month ago #11848 by emanuele
Hi,

to get the correct position you should calculate it with something like:
Code:
//Get the vPage PDFVPage *vvpage = [m_view vGetPage:m_cur_page]; //Get the page position int x = [vvpage GetVX:[m_view vGetX]]; int y = [vvpage GetVY:[m_view vGetY]]; //Get the correct position using scale float logicx = x/m_scale; float logicy = y/m_scale; //Use contentOffset to get the view position on the scrollView CGRect exampleRect = CGRectMake(logicx + self.contentOffset.x, logicy + self.contentOffset.y, 50, 50);
More
9 years 1 month ago #11849 by Rajat Singla
Thanks, that was some good advise.

But i need a solution where we can add button on PDFVPage itself, not on the view it is contained in.
More
9 years 1 month ago #11865 by emanuele
Hi,
PDFVPage is a NSObject and not contains a view, but draw the page content on a canvas using CG methods.
If you want to add objects on a page, you should use annotations or add subviews on the scrollview with the sample code of the previous post.
Time to create page: 0.482 seconds
Powered by Kunena Forum