Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8778403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:31:48+00:00 2026-06-13T19:31:48+00:00

I’m new to MonoTouch development and I would like to embed some PDF Viewing

  • 0

I’m new to MonoTouch development and I would like to embed some PDF Viewing functionality in my app. I have found several resources for doing that, however, I also see enough remarks about all the additional implementations to make it stable and fast.

I now see that there is a good ObjectiveC library which already implements a lot of functionality (CATiledLayer, multi-threading, page scrolling, thumb nails, device rotation …): https://github.com/vfr/Reader

The last days, after reading the monotoch binding documentation, I’m trying to bind this in MonoTouch, but without success.
I’m able to export it to a library (.a) file and I’ve created a binding API.

    //@interface ReaderDocument : NSObject <NSObject, NSCoding>
    [BaseType (typeof (NSObject))]
    interface ReaderDocument {

    //- (id)initWithFilePath:(NSString *)fullFilePath password:(NSString *)phrase;
    [Export("initWithFilePath:password")]
    IntPtr Constructor (string path, string phrase);

    //Properties
    [Export("guid")]
    string Guid { get;}

    [Export("fileDate")]
    NSDate FileDate { get;}

    [Export("lastOpen")]
    NSDate LastOpen { get;set;}

    [Export("fileSize")]
    NSNumber FileSize{ get;}

    [Export("pageCount")]
    NSNumber PageCount { get;}

    [Export("pageNumber")]
    NSNumber PageNumber { get;set;}

    [Export("bookmarks")]
    NSMutableIndexSet Bookmarks { get;}

    [Export("fileName")]
    string FileName { get;}

    [Export("password")]
    string Password { get;}

    [Export("fileURL")]
    NSUrl FileURL { get;}

    //Methods

    //+ (ReaderDocument *)withDocumentFilePath:(NSString *)filename password:(NSString *)phrase;
    [Static, Export("withDocumentFilePath:password")]
    ReaderDocument WithDocumentFilePath(string filename, string phrase);

    //+ (ReaderDocument *)unarchiveFromFileName:(NSString *)filename password:(NSString *)phrase;
    [Static, Export("unarchiveFromFileName:password")]
    ReaderDocument UnarchiveFromFileName(string filename, string phrase);

    //- (void)saveReaderDocument;
    [Export("saveReaderDocument")]
    void SaveReaderDocument();

    //- (void)updateProperties;
    [Export("updateProperties")]
    void updateProperties();
}

I’m very unsure about following line btw:

//@interface ReaderDocument : NSObject <NSObject, NSCoding>
    [BaseType (typeof (NSObject))]
    interface ReaderDocument

Not sure if I have to do something with the “”?

I can now create following code in MonoTouch

ReaderDocument doc =  ReaderDocument.withDocumentFilePath("Tamarin.pdf","");

or

ReaderDocument doc = new ReaderDocument("Tamarin.pdf","yrt");

Both are resulting in “unrecognized selector” error

  2012-11-04 22:15:05.731 PFDTest1[4149:1507] +[ReaderDocument withDocumentFilePath:password]: unrecognized selector sent to class 0x2f7738

[ERROR] FATAL UNHANDLED EXCEPTION: MonoTouch.Foundation.MonoTouchException: Objective-C     exception thrown.  Name: NSInvalidArgumentException Reason: +[ReaderDocument   withDocumentFilePath:password]: unrecognized selector sent to class 0x2f7738
at (wrapper managed-to-native)   MonoTouch.ObjCRuntime.Messaging:IntPtr_objc_msgSend_IntPtr_IntPtr   (intptr,intptr,intptr,intptr)
at VFRBinding4.ReaderDocument.withDocumentFilePath (System.String filename,  System.String phrase) [0x00000] in <filename unknown>:0 
at PFDTest1.AppDelegate.FinishedLaunching (MonoTouch.UIKit.UIApplication app, MonoTouch.Foundation.NSDictionary options) [0x00030] in /Users/matthiasvalcke/Projects/PFDTest1/PFDTest1/AppDelegate.cs:39 
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38 
at PFDTest1.Application.Main (System.String[] args) [0x00000] in  /Users/matthiasvalcke/Projects/PFDTest1/PFDTest1/Main.cs:17 

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:31:50+00:00Added an answer on June 13, 2026 at 7:31 pm

    There could be other issues but your bindings are wrong for the constructors, i.e.

    //- (id)initWithFilePath:(NSString *)fullFilePath password:(NSString *)phrase;
    [Export("initWithFilePath:password")]
    void InitWithFilePath(string path, string password);
    

    ObjectiveC init* selectors should be binded as C# constructors. E.g.

    [Export("initWithFilePath:password")]
    IntPtr Constructor (string path, string password);
    

    and that should be what you use to create the instance, e.g.

    ReaderDocument doc = new ReaderDocument ("sample.pdf", "");
    // ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I would like to run a str_replace or preg_replace which looks for certain words
I would like to count the length of a string with PHP. The string
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.