Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Tell us about your applications and your projects.
  • Page:
  • 1
  • 2

TOPIC:

Locking annotation added to PDF documents 5 years 11 months ago #13780

  • nermeen
  • nermeen's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
1. It mostly depends on your implementation flow, but the idea is to set
annot.ReadOnly = true;
when you want (after annotation creation for example).

Then check the readonly mode before the action you want to prevent, i.e. to prevent moving you can modify OnAnnotTouchMove, OnAnnotTouchEnd as follows:
if (m_status != PDFV_STATUS.STA_ANNOT) return false;
if (m_annot.ReadOnly)
{
    vAnnotEnd();
    return false;
}

2. We cannot understand the problem, can you please better explain?

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

Locking annotation added to PDF documents 5 years 11 months ago #13784

  • nermeen
  • nermeen's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
1. It can be immediately after the annotation creation:
page.AddAnnotTextNote()
PDFAnnot annot = page.GetAnnot(page.AnnotCount - 1);
annot.ReadOnly = true;
and/OR it can be done on the document level for all the annotations:
m_doc = new PDFDoc();
            m_doc.Open(m_stream, "");
            for(int i = 0; i < m_doc.PageCount; i++)
            {
                PDFPage page = m_doc.GetPage(i);
                page.ObjsStart();
                for(int j = 0; j < page.AnnotCount; j++)
                {
                    PDFAnnot annot = page.GetAnnot(j);
                    annot.ReadOnly = true;
                }
                page.Close();
            }
            m_doc.Save();
2. In the demo project this is handled via the annot open/perform button (first button on the left in the EditAnnotControl), check the video www.dropbox.com/s/e83n7c7l4zc4wu4/Note.zip?dl=0

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

Locking annotation added to PDF documents 5 years 11 months ago #13789

  • nermeen
  • nermeen's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
1. We have tested it with the demo project and no problem found, are you sure that annot.ReadOnly is false after this operation?

2. To jump the button click part, you can add the following to OnPDFAnnotClicked in PDFReaderPage:
...
                    mFormComboControl.Show();
                }
                else if (annot.IsPopup && annot.Type == 1) // add type check as it enters also for highlight annot
                {
                    //popup dialog to show text and subject.
                    //nuri is text content.
                    //subj is subject string.                   
                    OnPDFAnnotPopup(annot, annot.PopupSubject, annot.PopupText);
                    m_view.vAnnotEnd();
                    return;
                }
...

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

Locking annotation added to PDF documents 5 years 11 months ago #13797

  • nermeen
  • nermeen's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
You need to implement both the part that sets the read-only attribute and the part that checks it
//setting the all the annotation as read only
for (int i = 0; i < m_doc.PageCount; i++)
{
PDFPage page = m_doc.GetPage(i);
page.ObjsStart();
for (int j = 0; j < page.AnnotCount; j++)
{
PDFAnnot annot = page.GetAnnot(j);
annot.ReadOnly = true;
}
page.Close();
}
m_doc.Save();
And modify OnAnnotTouchMove, OnAnnotTouchEnd as follows:
if (m_status != PDFV_STATUS.STA_ANNOT) return false;
if (m_annot.ReadOnly)
{
    vAnnotEnd();
    return false;
}

You can download a sample from own.mobiles.it/index.php/s/LMkneRpyhCthTBc (password = Radaee)

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

Locking annotation added to PDF documents 5 years 11 months ago #13805

  • nermeen
  • nermeen's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
The demo we've sent is based on the latest stable release, so we do not think that updating these files will create an issue.
Make sure to update also the lib part (RDPDFLib bin and lib).

For the part related to the TextNote, is the part mentioned in www.radaeepdf.com/forum/Application-adop...s?limitstart=0#13789

add the following to OnPDFAnnotClicked in PDFReaderPage.cs:
...
                    mFormComboControl.Show();
                }
                else if (annot.IsPopup && annot.Type == 1) // add type check as it enters also for highlight annot
                {
                    //popup dialog to show text and subject.
                    //nuri is text content.
                    //subj is subject string.                   
                    OnPDFAnnotPopup(annot, annot.PopupSubject, annot.PopupText);
                    m_view.vAnnotEnd();
                    return;
                }
...

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

Locking annotation added to PDF documents 4 years 10 months ago #14428

  • mobileapps@dewa.gov.ae
  • mobileapps@dewa.gov.ae's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 19
  • Thank you received: 0
Hi
How the same thing is achieve in IOS? can you guide me?

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

  • Page:
  • 1
  • 2
Powered by Kunena Forum