- Posts: 2
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about iOS development and PDF
iOS Document_importPage return false
IP: 192.168.0.71
11 years 5 months ago #7592
by samdols
iOS Document_importPage return false was created by samdols
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?
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?
IP: 192.168.0.71
11 years 5 months ago #7593
by radaee
Replied by radaee on topic iOS Document_importPage return false
you shall call:
[doc setCache:...];
after [doc open:path1 :@""]; succeeded.
it is needed for import, temporary data for importing are stored in cache file.
[doc setCache:...];
after [doc open:path1 :@""]; succeeded.
it is needed for import, temporary data for importing are stored in cache file.
IP: 192.168.0.71
11 years 5 months ago #7608
by samdols
Replied by samdols on topic iOS Document_importPage return false
It works! Thank you very much.
Time to create page: 0.402 seconds