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

addAnnotBitmap doesn't work in 2.2.0

More
IP: 192.168.0.71 12 years 3 months ago #6409 by radaee
is it this?
BOOL result = [page addAnnotBitmap:mat :ref :YES :&rect];
More
IP: 192.168.0.71 12 years 3 months ago #6414 by Rossi
Are you saying I should use mat instead mat.handle?
In this case, mat is a PDFMatrix and addAnnotBitmap need a PDF_MATRIX.
More
IP: 192.168.0.130 12 years 3 months ago #6424 by emanuele
hi,

try to save m_doc before [self refresh]
More
IP: 192.168.0.71 12 years 3 months ago #6431 by Rossi
hi, crashes evenly.
More
IP: 192.168.0.71 12 years 3 months ago #6479 by stronglee
Hi,
Try iOS PDFViewer SDK 3.0.2 version. :-)
More
IP: 192.168.0.71 12 years 2 months ago #6531 by Rossi
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:
Code:
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
Code:
[m_view vAddAnnotBitmap:x y:y image:myimage];

and this is the vAddAnnotBitmap implemented in PDFView
Code:
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]; } }
Time to create page: 0.379 seconds
Powered by Kunena Forum