Hi,
i tried the new sdk, it is better in may aspect but i have the same problem within add a bitmap.
I set the cache file in pdfOpen:
if(SYS_VERSION>=7.0)
{
m_view = [[PDFView alloc] initWithFrame:CGRectMake(0, 0, rect.size.width, rect.size.height)];
}
else
{
m_view = [[PDFView alloc] initWithFrame:CGRectMake(0, 0, rect.size.width, rect.size.height-20-44)];
}
NSString *cachesPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
cachesPath = [cachesPath stringByAppendingPathComponent:@"file.dat"];
[m_doc setCache:cachesPath];
[m_view vOpen :m_doc :(id<PDFViewDelegate>)self];
In onsigletapped i insert this line
[m_view vAddAnnotBitmap:x y:y image:myimage];
and this is the vAddAnnotBitmap implemented in PDFView
struct PDFV_POS pos;
[m_view vGetPos:&pos:x:y];
if(pos.pageno>=0)
{
PDFVPage *vpage = [m_view vGetPage:pos.pageno];
PDFPage *page = [vpage GetPage];
PDF_RECT rect;
rect.bottom = 300;
rect.left = x;
rect.right = y;
rect.top = 100;
if( page != NULL )
{
CGImageRef ref = [image CGImage];
PDFMatrix *mat = [vpage CreateInvertMatrix:self.contentOffset.x * m_scale :self.contentOffset.y * m_scale];
BOOL result = [page addAnnotBitmap0:mat :ref :YES :&rect];
//BOOL result = Page_addAnnotBitmap(mat.handle, mat.handle, ref, 1, &rect);
Matrix_destroy(mat.handle);
[m_view vRenderSync:pos.pageno];
[m_doc save];
[self refresh];
}
}