Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF

TOPIC:

addAnnotBitmap doesn't work in 2.2.0 6 years 8 months ago #6539

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1037
  • Karma: 43
  • Thank you received: 62
try this:
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];
[mat TransformRect : &rect ];
BOOL result = [page addAnnotBitmap: ref :YES :&rect];
Matrix_destroy(mat.handle);
[m_view vRenderSync:pos.pageno];
[m_doc save];
[self refresh];
}
}

Please Log in or Create an account to join the conversation.

addAnnotBitmap doesn't work in 2.2.0 6 years 8 months ago #6544

  • Rossi
  • Rossi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 49
  • Karma: 1
  • Thank you received: 0
No, it doesn't work. It's the same before, the first insert is ok but the others crashes the app.

Please Log in or Create an account to join the conversation.

addAnnotBitmap doesn't work in 2.2.0 6 years 7 months ago #6773

  • Rossi
  • Rossi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 49
  • Karma: 1
  • Thank you received: 0
Hi, there is news about this problem? I use the latest beta release but the problem persist.

Please Log in or Create an account to join the conversation.

addAnnotBitmap doesn't work in 2.2.0 6 years 7 months ago #6776

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1037
  • Karma: 43
  • Thank you received: 62
Page object obtained from PDFVPage are not persist object.
you shall always get Page object from PDFVPage every time.
Page object obtained from PDFVPage will freed after vRender invoked.

Please Log in or Create an account to join the conversation.

addAnnotBitmap doesn't work in 2.2.0 6 years 6 months ago #6814

  • Rossi
  • Rossi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 49
  • Karma: 1
  • Thank you received: 0
Well, I do understand this but, the point is a crash in accessing m_cache status after I had a bitmap annotation.
It seems that the problem is connected with this line of code:

Matrix_destroy(mat.handle);

Commenting it out, we have no immediate crash with EXC_BAD_ACCESS, but I guess this could cause memory problems later?

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum