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

TOPIC:

Request to add the free text annotation feature in Windows Universal sample 6 years 1 month ago #13624

  • nermeen
  • nermeen's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
To add a free text annotation, you can use
public bool AddAnnotEditbox(PDFRect rect, int line_clr, float line_w, int fill_clr, float tsize, int text_clr);
example:
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)

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

Request to add the free text annotation feature in Windows Universal sample 6 years 1 month ago #13627

  • nermeen
  • nermeen's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
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.

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

Request to add the free text annotation feature in Windows Universal sample 6 years 1 month ago #13630

  • nermeen
  • nermeen's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
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)
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;
	}
Add a method to cancel the free-text status (and call it based on your user event)
public void vFreeTextCancel()
	{
		if (m_status == PDFV_STATUS.STA_FREE_TEXT)
		{
			...
		}
	}
Add a method to end the free-text status and add the annotation (and call it based on your user event)
public void vFreeTextEnd()
	{
		if (m_status == PDFV_STATUS.STA_FREE_TEXT)
		{
			...
		}
	}
Add a method to handle touch down event
private bool OnFreeTextTouchBegin(Point point)
    {
		...
	}
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
private bool OnFreeTextTouchMove(Point point)
    {
		...
	}
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
private bool OnFreeTextTouchEnd(Point point)
    {
		...
	}
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
private void drawFreeText()
	{
		...
	}
Add in vDraw method a call to a method to draw the free-text annotation
...
	drawAnnot();
	drawInk();
	drawEllipse();
	drawRects();
	drawLines();
	drawFreeText();
	...

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

Last edit: by nermeen.

Request to add the free text annotation feature in Windows Universal sample 6 years 1 month ago #13632

  • nermeen
  • nermeen's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
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.

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

Request to add the free text annotation feature in Windows Universal sample 6 years 4 weeks ago #13635

  • nermeen
  • nermeen's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
Sales team has responded to the ticket.

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

  • Page:
  • 1
Powered by Kunena Forum