- Posts: 962
- Thank you received: 87
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Tell us about your applications and your projects.
Locking annotation added to PDF documents
IP: 93.63.153.96
7 years 10 months ago #13780
by nermeen
Locking annotation added to PDF documents was created by nermeen
1. It mostly depends on your implementation flow, but the idea is to set
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:
2. We cannot understand the problem, can you please better explain?
Code:
annot.ReadOnly = true;
Then check the readonly mode before the action you want to prevent, i.e. to prevent moving you can modify OnAnnotTouchMove, OnAnnotTouchEnd as follows:
Code:
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?
IP: 93.37.175.55
7 years 10 months ago #13784
by nermeen
Replied by nermeen on topic Locking annotation added to PDF documents
1. It can be immediately after the annotation creation:
and/OR it can be done on the document level for all the annotations:
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
Code:
page.AddAnnotTextNote()
PDFAnnot annot = page.GetAnnot(page.AnnotCount - 1);
annot.ReadOnly = true;
Code:
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();
IP: 212.97.62.176
7 years 10 months ago #13789
by nermeen
Replied by nermeen on topic Locking annotation added to PDF documents
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:
2. To jump the button click part, you can add the following to OnPDFAnnotClicked in PDFReaderPage:
Code:
...
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;
}
...
IP: 212.97.62.176
7 years 10 months ago #13797
by nermeen
Replied by nermeen on topic Locking annotation added to PDF documents
You need to implement both the part that sets the read-only attribute and the part that checks it
And modify OnAnnotTouchMove, OnAnnotTouchEnd as follows:
You can download a sample from own.mobiles.it/index.php/s/LMkneRpyhCthTBc (password = Radaee)
Code:
//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();
Code:
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)
IP: 37.183.44.177
7 years 10 months ago #13805
by nermeen
Replied by nermeen on topic Locking annotation added to PDF documents
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:
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:
Code:
...
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;
}
...
- [email protected]
- Offline
- New Member
-
Less
More
- Posts: 19
- Thank you received: 0
IP: 86.99.147.79
6 years 8 months ago #14428
by [email protected]
Replied by [email protected] on topic Locking annotation added to PDF documents
Hi
How the same thing is achieve in IOS? can you guide me?
How the same thing is achieve in IOS? can you guide me?
Time to create page: 0.371 seconds