Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF
  • Page:
  • 1

TOPIC:

Issue in developement - IOS 9 years 8 months ago #7013

  • vkinjan86
  • vkinjan86's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
Hello their...
I have an error in following line of code ,Which is directly copy-paste from pdf file included in sdk zip.
I have create PDf Doc object like :
PDF_DOC m_doce;
And I have Error in code below:
- (int)PDFOpen:(NSString *)path withPassword:(NSString *)pwd
{
[self PDFClose];
const char *cpath = [path UTF8String];
PDF_ERR err = 0;
const char *password = [pwd UTF8String];
m_doce = Document_open(cpath, password, &err);
if( m_doce == NULL )
{
switch( err )
{
case err_password:
return 2;
break;
default: return 0;
}
}
CGRect rect = [[UIScreen mainScreen]bounds];
float hi = self.navigationController.navigationBar.bounds.size.height;
m_view = [[PDFView alloc] initWithFrame:CGRectMake(0, 0, rect.size.width, rect.size.height-20-hi)];
[m_view vOpen:(m_doce): self];<
<
Error showing on m_doce
[self.view addSubview:m_view];
return 1;
}
For further explanation I have attached image also..
I am using
Xcode : Version 5.1.1 (5B1008)
iOS Simulator : Version 7.1 (463.9.41)
OS X : 10.9.4
Attachments:

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

Last edit: by shlomok.

Issue in developement - IOS 9 years 8 months ago #7015

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Hi,

try to init m_doc in this way:

PDF_ERR err = 0;
m_doc = [[PDFDoc alloc] init];
err = [m_doc open:path :pwd];

instead of:

m_doce = Document_open(cpath, password, &err);

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

  • Page:
  • 1
Powered by Kunena Forum