- Posts: 8
- Thank you received: 0
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.
- Rajat Singla
- Topic Author
- Offline
- New Member
-
Less
More
9 years 1 month ago #11842
by Rajat Singla
Add a button on top side corner of the pdf page. was created by Rajat Singla
Hii.
Can we add a button on the top side corner of the pdfPage.
if yes, then how?
Thanks.
Can we add a button on the top side corner of the pdfPage.
if yes, then how?
Thanks.
9 years 1 month ago #11844
by emanuele
Replied by emanuele on topic Add a button on top side corner of the pdf page.
Hi,
you can consider the pdf page like a normal view and add objects with standard development methods.
you can consider the pdf page like a normal view and add objects with standard development methods.
- Rajat Singla
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 8
- Thank you received: 0
9 years 1 month ago - 9 years 1 month ago #11845
by Rajat Singla
Replied by Rajat Singla on topic Add a button on top side corner of the pdf page.
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.
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.
9 years 1 month ago #11848
by emanuele
Replied by emanuele on topic Add a button on top side corner of the pdf page.
Hi,
to get the correct position you should calculate it with something like:
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);
- Rajat Singla
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 8
- Thank you received: 0
9 years 1 month ago #11849
by Rajat Singla
Replied by Rajat Singla on topic Add a button on top side corner of the pdf page.
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.
But i need a solution where we can add button on PDFVPage itself, not on the view it is contained in.
9 years 1 month ago #11865
by emanuele
Replied by emanuele on topic Add a button on top side corner of the pdf page.
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.
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