PDFTron SDK v9.0.0 iOS error

Hello,

I have recently updated my PDFTron.iOS SDK from v8.0.0 to v9.0.0. Ever since I have updated my sdk package I keep getting the following error:

'Could not resolve type with token 01000023 from typeref (expected class 'ObjCRuntime.NativeObjectExtensions' in assembly 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065')'

My project is currently using the PTDocumentViewController class which is now deprecated. I have transitioned into the new PTDoucmentController class yet I am still getting the same error. Could anyone shed some light on this error and where I could be going wrong.

Thanks in advanced,
-Dante

Hi Dante,

Thank you for getting in touch with us about this.
Are you able to reproduce this behaviour on one of the sample apps in the SDK download?

Does the issue still occur if you update to the 9.0.1-preview release?

(you will need to tick the Show pre-release packages checkbox in the bottom left of the Manage NuGet Packages window)

Jamie,

Thanks for the reply! I tried updating the sdk to the 9.0.1-preview release, yet I still get the error:

Could not resolve type with token 01000023 from typeref (expected class 'ObjCRuntime.NativeObjectExtensions' in assembly 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065')'

My project was working perfectly fine on pdftron sdk 8.0.0, however after updating I keep getting this error. Even using the now deprecated class PTDocumentViewController class does not work. After seeing my project was not working anymore, I thought it may have to do with my utilization of the PTDcoumentViewController class, so I changed it to the PTDocumentController class by following this guide. However I still end up running into the same error.

Any additional help/knowledge on the matter would be greatly appreciated.

Hi Dante,

Are you able to share a sample project which shows this error? Perhaps by modifying one of the sample projects in the SDK download?

Jamie,

I was able to get my application working by downgrading from sdk v9.0.0 to v8.1.2 and implementing the new PTDocumentController class in place of the PTDocumentViewController. I have tried this exact solution on the v9.0.0 sdk but no luck.

One other thing I noticed while on v8.1.2 is this display issue that occurs sometimes. The display for the PTDoucmentController gets pushed up towards the top of the screen, making it impossible to to press any buttons on the toolbar. (See below)

Screenshot 2021-05-26 153808

Flipping the phone horizontally does fix this issue but presents another issue…
This issue prevents me from seeing the annotation toolbar. Even selecting different Tool Groups does not display the annotation tools. The annotation toolbar appears for a split second before my document is loaded, once my document is loaded the annotation toolbar will disappear and not return.

I know I kind of opened a can of worms here. Was wondering if these issues were fixed in v9.0.0 or if I am missing something simple.

I have been referring to this documentation

I have included,
_documentController.ToolGroupManager.SelectedGroup = _documentController.ToolGroupManager.AnnotateItemGroup;

but the annotation toolbar still doesn’t appear. I get this error message when selecting a different Tool Group.

[Presentation] Presenting view controller <UINavigationController: 0x7ffa8a907200> from detached view controller <Eureka_iOS_UI_PTDocumentController: 0x7ffa86cbf200> is discouraged.

Thanks,
-DD