Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Development and suggestions about third part tool integration.
Cordova, Xamarin, Basic4Android topics are listed here.

Xamarin.Android annotation RemoveFromPage help

More
IP: 192.168.0.71 8 years 9 months ago #12441 by digitalpages
Hello, I am having trouble in removing a highlight annotation from pdf on Xamarin Android. I'm successfully able to add highlights but can't seem to figure out why removing them using RemoveFromPage() won't work.

Here are some details
  • Triple checked package name and everything related to licensing (we are using professional version).
  • Successfully implemented Xamarin.iOS adding and removing highlights. We are not mistakenly using the same package name from the iOS app :P
  • We are asking to render the page again after removing annotation.
  • We are using the latest version (at the writing of this post).

Here is some code:

NativePage is Page.Annotation class from Com.radaee.pdf
Code:
public Task<ICorePdfAnnotation> AddHighlight(ICorePdfSel selection, string color) { if (!InitObjs()) return Task.FromResult((ICorePdfAnnotation)null); var status = NativePage?.AddAnnotMarkup(selection.StartIndex, selection.EndIndex, 0) == true; ICorePdfAnnotation result = null; if (status) { var annotation = NativePage?.GetAnnot(NativePage.AnnotCount - 1); var colorObj = Color.ParseColor(color); annotation.SetFillColor(colorObj.ToArgb()); annotation.SetName("Test"); result = new AndroidPdfAnnotationWrapper(annotation); } return Task.FromResult(result); }
Then the wrapper class:
Code:
public class AndroidPdfAnnotationWrapper : ICorePdfAnnotation { private Page.Annotation annotation; public AndroidPdfAnnotationWrapper(Page.Annotation annotation) { this.annotation = annotation; } public bool Remove() { var status = annotation.RemoveFromPage(); return status; } }
the "status" return is always false


Any other additional debugging tips you guys could share?

Thanks...
More
IP: 192.168.0.71 8 years 9 months ago #12443 by nermeen
We have tried the below code, and we couldn't reproduce the issue:
Code:
Document document = new Document(); if (document.Open(path, "") == 0) { bool result = false; Page page = document.GetPage(0); page.ObjsStart(); if (page.AddAnnotMarkup(170, 616, 0)) { Page.Annotation annot = page.GetAnnot(page.AnnotCount - 1); if (annot != null) { result = annot.RemoveFromPage(); } } }
If you are not saving after adding the annotation, make sure to use the same page object, and not to close it, or you will lose your modifications.
More
IP: 85.249.28.1 4 years 3 months ago #15650 by никкуз1
Hi. What version of the license do I need to work with annotations? Now I have a standard license. I can add annotations with text selection (m_view.vSelMarkup(color, itype)). But I cannot remove them (m_view.vAnnotRemove ();). I have the same problem.

if (m_status != PDFV_STATUS.STA_ANNOT) return;
bool r = m_annot.RemoveFromPage();
vRenderSync(m_pages[m_annot_pos.pageno]);
vDraw();
vAnnotEnd();

r - always false

I do not need to save modified pdf.
I try demo licence:
bool r = PDFGlobal.ActiveLicense(2, "Radaee", "[email protected]", "YOOW28-VS57CA-H3CRUZ-WAJQ9H-5R5V9L-KM0Y1L");
OnPDFAnnotClicked(PDFPage page, PDFAnnot annot) is not called.
More
IP: 2.234.168.74 4 years 3 months ago #15651 by support
Dear user,
    to interact and edit annotations you need an active Professional or Premium license.
You may check the trial key but you shall change your current application package name from your own to the same we use in the demo project.

 
Time to create page: 0.536 seconds
Powered by Kunena Forum