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

duplicate note problem

More
IP: 192.168.0.70 12 years 8 months ago - 12 years 8 months ago #3413 by truculent
hi i add new button too toolbar for add note in custom position !
i set touch x,y & when user press save button i pass x&y to pos x & pos y!
it's work Like charm :)
but my problem is when open a creatED note & again press save button it create new Note :(

-(void)OnSaveTextAnnot:(NSString *)textAnnot
{
[m_view vAddTextAnnot:posx :posy :textAnnot];
wantAddNote = false;
}

how i can fix it ?

i want only update content of note :(
Last edit: 12 years 8 months ago by patel_patel_patel.
More
IP: 192.168.0.70 12 years 8 months ago #3417 by stronglee
Replied by stronglee on topic duplicate note problem
Hi,

[m_view vAddTextAnnot:posx :posy :textAnnot]; this method will create a new TextAnnot icon.

when press addnote button in toolbar,
-(void)OnSaveTextAnnot:(NSString *)textAnnot
{
[m_view vAddTextAnnot:posx :posy :textAnnot];
wantAddNote = false;
}
this method just use to create new textAnnot,

when you single tap the textAnnot icon ,use a new method to Modify textAnnot

-(void)vModifyTextAnnot:(int)x :(int)y :(NSString *)text
{
struct PDFV_POS pos;
[m_view vGetPos:&pos:x:y];
if(pos.pageno>=0)
{
PDFVPage *vpage = [m_view vGetPage:pos.pageno];
PDF_PAGE page = [vpage GetPage];

float pdf_x = [vpage ToPDFX:x :[m_view vGetX]];
float pdf_y = [vpage ToPDFY:y :[m_view vGetY]];

if( page != NULL )
{
PDF_MATRIX mat = [vpage CreateMatrix];
//PDF_ANNOT annot = Page_getAnnot( page, Page_getAnnotCount(page) - 1 );
PDF_ANNOT annot = Page_getAnnotFromPoint(page, x, y);
Page_setAnnotPopupText(page, annot, [text UTF8String]);
Matrix_destroy(mat);
}
}
}
Time to create page: 0.408 seconds
Powered by Kunena Forum