- 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.
Request to add the free text annotation feature in Windows Universal sample
IP: 192.168.0.71
7 years 11 months ago #13624
by nermeen
To add a free text annotation, you can use
example:
to add text to the page content, you can check add text part in Add text to document (Windows)
Code:
public bool AddAnnotEditbox(PDFRect rect, int line_clr, float line_w, int fill_clr, float tsize, int text_clr);
Code:
PDFPage page = m_doc.GetPage(i);
page.ObjsStart();
var rect = new PDFRect
{
bottom = 250,
left = 150,
right = 250,
top = 150
};
page.AddAnnotEditbox(rect, 0x000000, 3, 0xffffff, 10, 0x000000);
to add text to the page content, you can check add text part in Add text to document (Windows)
IP: 192.168.0.71
7 years 11 months ago #13627
by nermeen
Replied by nermeen on topic Request to add the free text annotation feature in Windows Universal sample
AddAnnotEditbox -> annotations are supported starting from the professional license.
Add text to page content (add text to pdf directly) -> a premium license is needed.
Yes, you can check the sample code.
Add text to page content (add text to pdf directly) -> a premium license is needed.
Yes, you can check the sample code.
IP: 192.168.0.71
7 years 11 months ago - 7 years 11 months ago #13630
by nermeen
Replied by nermeen on topic Request to add the free text annotation feature in Windows Universal sample
Dear Alok,
as you see the multiline text box are handled with modal edit-text to avoid some limitations and lack of speed of MS Windows APIs.
For these reasons I’m sorry to inform you that we won’t support inlined multiline edit text.
To add the support of free-text annotation, as the rect annotation for example, you need to:
(the method body can be added easily as the rect annotation for example)
Add a new status in PDFV_STATUS
...
STA_LINE = 8,
STA_FREE_TEXT = 9
}
Add a method to start the free-text status (and call it based on your user event)
Add a method to cancel the free-text status (and call it based on your user event)
Add a method to end the free-text status and add the annotation (and call it based on your user event)
Add a method to handle touch down event
Add in vOnTouchDown method a call to a method to handle the free-text annotation
...
if (OnFreeTextTouchBegin(pt)) return;
...
Add a method to handle touch move event
Add in vOnTouchMove method a call to a method to handle the free-text annotation
...
if (OnFreeTextTouchMove(pt)) return;
...
Add a method to handle touch end event
Add in vOnTouchUp method a call to a method to handle the free-text annotation
...
if (OnFreeTextTouchEnd(pt)) return;
...
Add a method to draw the free-text annotation
Add in vDraw method a call to a method to draw the free-text annotation
as you see the multiline text box are handled with modal edit-text to avoid some limitations and lack of speed of MS Windows APIs.
For these reasons I’m sorry to inform you that we won’t support inlined multiline edit text.
To add the support of free-text annotation, as the rect annotation for example, you need to:
(the method body can be added easily as the rect annotation for example)
Add a new status in PDFV_STATUS
...
STA_LINE = 8,
STA_FREE_TEXT = 9
}
Add a method to start the free-text status (and call it based on your user event)
Code:
public bool vFreeTextStart()
{
if (m_doc == null || !m_doc.CanSave || m_pages == null) return false;
if (m_status == PDFV_STATUS.STA_NONE)
{
m_status = PDFV_STATUS.STA_FREE_TEXT;
...
}
return false;
}
Code:
public void vFreeTextCancel()
{
if (m_status == PDFV_STATUS.STA_FREE_TEXT)
{
...
}
}
Code:
public void vFreeTextEnd()
{
if (m_status == PDFV_STATUS.STA_FREE_TEXT)
{
...
}
}
Code:
private bool OnFreeTextTouchBegin(Point point)
{
...
}
...
if (OnFreeTextTouchBegin(pt)) return;
...
Add a method to handle touch move event
Code:
private bool OnFreeTextTouchMove(Point point)
{
...
}
...
if (OnFreeTextTouchMove(pt)) return;
...
Add a method to handle touch end event
Code:
private bool OnFreeTextTouchEnd(Point point)
{
...
}
...
if (OnFreeTextTouchEnd(pt)) return;
...
Add a method to draw the free-text annotation
Code:
private void drawFreeText()
{
...
}
Code:
...
drawAnnot();
drawInk();
drawEllipse();
drawRects();
drawLines();
drawFreeText();
...
Last edit: 7 years 11 months ago by nermeen.
IP: 192.168.0.71
7 years 11 months ago #13632
by nermeen
Replied by nermeen on topic Request to add the free text annotation feature in Windows Universal sample
You can change the size of the Editbox annotation using PDFAnnot.Rect.
providing user ribbon on edges of editbox -> This is not supported for the same reasons of not supporting inlined multiline edit text.
providing user ribbon on edges of editbox -> This is not supported for the same reasons of not supporting inlined multiline edit text.
IP: 192.168.0.71
7 years 11 months ago #13635
by nermeen
Replied by nermeen on topic Request to add the free text annotation feature in Windows Universal sample
Sales team has responded to the ticket.
Time to create page: 0.395 seconds