- Posts: 6
- Thank you received: 0
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
App crash when call Page_setAnnotEditText
IP: 192.168.0.70
12 years 4 months ago #3930
by superpisu
App crash when call Page_setAnnotEditText was created by superpisu
HI,
When i call Page_setAnnotEditText app crash with EXC_BAD_ACCESS
this is my code
any suggestion?
When i call Page_setAnnotEditText app crash with EXC_BAD_ACCESS
this is my code
Code:
PDF_PAGE currentPage = Document_getPage(m_doc, page);
Page_objsStart( currentPage );
int annotationCount = Page_getAnnotCount( currentPage );
NSLog(@"%d",annotationCount);
if (annotationCount) {
PDF_ANNOT myannot = Page_getAnnot(currentPage, 0 );
int annotType = Page_getAnnotEditType( currentPage, myannot );
NSLog(@"annot type = %d",annotType);
if (annotType==1) {
PDF_RECT rect;
bool ret = Page_getAnnotEditTextRect( currentPage, myannot, &rect );
NSLog(@"left %f",rect.left);
NSLog(@"bottom %f",rect.bottom);
NSLog(@"right %f",rect.right);
NSLog(@"top %f",rect.top);
char annotText=@"";
bool ret2 = Page_getAnnotEditText( currentPage, myannot, &annotText, 1024);
if ( annotText) {
NSString *text = [[NSString alloc] initWithUTF8String:annotText];
NSLog(@"%@",text);
}else{
NSLog(@"no text");
}
bool ret3 = Page_setAnnotEditText(currentPage, myannot, [@"test" UTF8String]);
any suggestion?
IP: 192.168.0.70
12 years 4 months ago - 12 years 4 months ago #3933
by radaee
Replied by radaee on topic App crash when call Page_setAnnotEditText
char annotText[1024];
Last edit: 12 years 4 months ago by .
IP: 192.168.0.70
12 years 4 months ago #3938
by superpisu
Replied by superpisu on topic App crash when call Page_setAnnotEditText
crash at this line : bool ret3 = Page_setAnnotEditText(currentPage, myannot, [@"test" UTF8String]);
not use annotText
not use annotText
IP: 192.168.0.70
12 years 4 months ago #3957
by stronglee
Replied by stronglee on topic App crash when call Page_setAnnotEditText
Hi,
example for Page-getAnnotPopupText:
char text[1024];
for (int i = 0; i < 1024; i++) {
text = "";
}
Page_getAnnotPopupText(page, annot, text, 1024);
NSString *ns = [[NSString alloc] initWithUTF8String:text];
when use Page_setAnnotPopupText,there need call Page_getAnnot() beforeļ¼
PDF_ANNOT annot = Page_getAnnot( page, Page_getAnnotCount(page) - 1 );
Page_setAnnotPopupText(page, annot, [text UTF8String]);
example for Page-getAnnotPopupText:
char text[1024];
for (int i = 0; i < 1024; i++) {
text = "";
}
Page_getAnnotPopupText(page, annot, text, 1024);
NSString *ns = [[NSString alloc] initWithUTF8String:text];
when use Page_setAnnotPopupText,there need call Page_getAnnot() beforeļ¼
PDF_ANNOT annot = Page_getAnnot( page, Page_getAnnotCount(page) - 1 );
Page_setAnnotPopupText(page, annot, [text UTF8String]);
IP: 192.168.0.131
12 years 3 months ago #4140
by emanuele
Replied by emanuele on topic App crash when call Page_setAnnotEditText
Hi,
can you send me your PDF?
Already with the edit text annotation.
I will use it to test Page_setAnnotEditText method
can you send me your PDF?
Already with the edit text annotation.
I will use it to test Page_setAnnotEditText method
IP: 192.168.0.151
12 years 2 months ago #4533
by emanuele
Replied by emanuele on topic App crash when call Page_setAnnotEditText
Hi,
a new version is now available with Page_setAnnotEditText method fixed.
Now you only have to set the annot text, re-render the page and save the m_doc, like this:
[annot setEditText:@"test"];
[m_view vRenderPage:pos.pageno];
[m_doc save];
You can find this implementation in PDFView.m: onSingleTap method.
www.androidpdf.mobi/download/download-io...56-ios-pdfviewer-182
a new version is now available with Page_setAnnotEditText method fixed.
Now you only have to set the annot text, re-render the page and save the m_doc, like this:
[annot setEditText:@"test"];
[m_view vRenderPage:pos.pageno];
[m_doc save];
You can find this implementation in PDFView.m: onSingleTap method.
www.androidpdf.mobi/download/download-io...56-ios-pdfviewer-182
Time to create page: 0.448 seconds