Show PDF in Xamarin - navigation problem - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Development and suggestions about third part tool integration.
Cordova, Xamarin, Basic4Android topics are listed here.
  • Page:
  • 1

TOPIC: Show PDF in Xamarin - navigation problem

Show PDF in Xamarin - navigation problem 1 year 6 months ago #12407

  • shm04
  • shm04's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
Hello,
I use Xamarin plugin. Current question is for iOS implementation. I use code from your sample at Git.
The problem is, that in your code Radaeepdf navigation bar (bookmarks, print, etc) can be shown only with next code:
...
UIViewController controller = plugin.OpenFromAssets("test.pdf", "");
...
this.NavigationController.PushViewController(controller, true);

So using of NavigationController is mandatory. But how to call this from Xamarin PCL code?
I tried next code in PCL::

PdsCrossPlatformPage myPage = new PdsCrossPlatformPage(n);
this.Navigation.PushAsync(myPage);
...
then I have to wait when page appears and call code to use NavigationController in iOS

PCL:
Xamarin.Forms.Device.StartTimer(TimeSpan.FromMilliseconds(1000), () =>
{
myPage.UseNav();
return false;
});

and here is code in iOS page renderer for PdsCrossPlatformPage
public void UseNav()
...
UIViewController controller = plugin.OpenFromPath("myfile.pdf", "");
/* all initialization for plugin has been applied before - settings, etc
selector = new RadaeeDelegate(plugin);
plugin.SetDelegate(selector);
*/

this.NavigationController.PushViewController(controller, true);

Yes, it shows file. And Radaee navigation bar exists too - see attach..
But too many problems and questions are here:
1) I need to wait until page appears - see timer above, Otherwise this.NavigationController is null
2) There are TWO page appears in Navigation - first empty PdsCrossPlatformPage, and then by timer - real viewer
3) No search button in Nav bar
Could you please help me to use it correctly? I have license for iOS and Android - I can provide you with data in secured message.
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by shm04.

Show PDF in Xamarin - navigation problem 1 year 6 months ago #12408

  • shm04
  • shm04's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
PS. I have activated license. Now Search button exists in Navbar, and controls looks bit other. So question 3) has been closed.

Please Log in or Create an account to join the conversation.

Show PDF in Xamarin - navigation problem 1 year 5 months ago #12430

  • support
  • support's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 571
  • Karma: 6
  • Thank you received: 46
Apologize for very late reply.
We're working on some improvement on the core and Objective-C frameworks which shall reflect on the Xamarin/Cordova module too.
Hopefully at the beginning of next week we shall publish a new Xamarin release.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum