CGPDFDocumentCreateWithProvider
taking long time for initialization using CGDataProviderDirectCallbacks
data provider.
Here is code snippet:
CGDataProviderDirectCallbacks directCallBacks;
directCallBacks.version = 0;
directCallBacks.getBytePointer = NULL;
directCallBacks.releaseBytePointer = NULL;
directCallBacks.releaseInfo = NULL;
directCallBacks.getBytesAtPosition = getBytesAtOffset;
dataProvider = CGDataProviderCreateDirect(NULL,fsize,&directCallBacks);
CGPDFDocumentRef pdf = CGPDFDocumentCreateWithProvider(dataProvider);
It immediately starts calling getBytesAtOffset
in while initializing using CGPDFDocumentCreateWithProvider
which is not expected. (It should not start scanning pdf immediately).
results in taking long time to complete this CGPDFDocumentRef pdf = CGPDFDocumentCreateWithProvider(dataProvider);
Please suggest me if I am doing it wrongly.