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

TOPIC:

iOS Document_importPage return false 9 years 5 months ago #7592

  • samdols
  • samdols's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
Hello,

I am using premium SDK, and tried to import page to destination pdf document as follows.

========================================================
PDF_ERR err = 0;
PDFDoc *doc = [[PDFDoc alloc] init];
err = [doc open:path1 :@""];

switch( err )
{
case err_ok:
break;
default:
return nil;
break;
}

PDFDoc *page2doc = [[PDFDoc alloc] init];
err = [page2doc open:path2 :@""];

switch( err )
{
case err_ok:
break;
default:
return nil;
break;
}

PDFImportCtx *ctx = [doc newImportCtx:page2doc];
bool ret = [ctx import:0 :1];

// PDF_IMPORTCTX ctx = Document_importStart(doc.handle, page2doc.handle);
// bool ret = Document_importPage(doc.handle, ctx, 0, 1 );
// Document_importEnd(doc.handle, ctx);


========================================================

Both of PDFDoc objects aren't nil and PDFImpoerCtx is not nil.
but "ret" is always false. (Both of two pdf files have only one page).
activePremium function returns true so I think there is no problem using premium SDK.

Can anybody help me?

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

iOS Document_importPage return false 9 years 5 months ago #7593

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
you shall call:
[doc setCache:...];
after [doc open:path1 :@""]; succeeded.

it is needed for import, temporary data for importing are stored in cache file.
The following user(s) said Thank You: ashokgelal

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

iOS Document_importPage return false 9 years 5 months ago #7608

  • samdols
  • samdols's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
It works! Thank you very much.

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

  • Page:
  • 1
Powered by Kunena Forum