I tried to import one page from an existing PDF into a newly created one, but can't get it to work. ImportPage() returns false.
What are I doing wrong here?
Global.Init( this );
String srcPath = getFilesDir() + "/test.PDF";
String dstPath = getFilesDir() + "/out.pdf";
Document srcPdf = new Document();
Document dstPdf = new Document();
srcPdf.Open(srcPath, null);
dstPdf.Create(dstPath);
Document.ImportContext context = dstPdf.ImportStart(srcPdf);
boolean success = dstPdf.ImportPage(context, 0, 0);
context.Destroy();
dstPdf.Save();
dstPdf.Close();
srcPdf.Close();