Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1
  • 2

TOPIC:

how to add the text at touch position. 8 years 2 months ago #10341

  • ankur123987
  • ankur123987's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Available as freelancer (ex website to app 30min)
  • Posts: 97
  • Thank you received: 0
Hi Radaeepdf team,
I am using following code for draw text at pdf . I modified the code as suggested in www.radaeepdf.com/forum/roadmap-and-rele...-box-at-pdf?start=12
method of OnPDFBlankTapped but when i try to add the text at tap location . text is not added at there its vary from tap location. one more point how can i add the underline style in text please help

method of
PageContent content = new PageContent();
content.Create();//create content, do not forget.
content.GSSave();
Matrix mat = new Matrix( 1, 1, X, Y);
content.GSSetMatrix(mat);
mat.Destroy();

Page page = doc.GetPage(currentpage_num);

Document.DocFont dfont = doc.NewFontCID("Roboto-Regular", 1);//bold and embed in horizontal writing
ResFont rfont = page.AddResFont(dfont);

content.TextBegin();
content.TextSetFont(rfont, p2);//set font and size

content.SetFillColor(colorcode);
content.SetStrokeColor(0xD50321);
content.TextSetCharSpace(0);

content.TextSetRenderMode(0);//fill and stroke

content.DrawText(textstr);
content.TextEnd();

content.GSRestore();

//add content to page
page.AddContent(content, true);

content.Destroy();

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

how to add the text at touch position. 8 years 1 month ago #10345

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
what does page.AddContent(content, true); return?

If it returns true I think you have some problems with the position so with the matrix..
If it returns false there are some problems with the others parameters you are using.
Remember that to use these methods you need a premium license..

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

how to add the text at touch position. 8 years 1 month ago #10347

  • ankur123987
  • ankur123987's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Available as freelancer (ex website to app 30min)
  • Posts: 97
  • Thank you received: 0
I am using premium license . i tried with both true and false but its not working i checked matrix as you suggested in this thread

www.radaeepdf.com/forum/roadmap-and-rele...-box-at-pdf?start=12 .

Could you make a saperate method for static text or modify my code . ? can i underline my text? please help

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

how to add the text at touch position. 8 years 1 month ago #10348

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
please answer my question : what does page.AddContent(content, true); return?

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

how to add the text at touch position. 8 years 1 month ago #10349

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
have edited the article www.radaeepdf.com/support/knowledge-base?view=kb&kbartid=35
Please try it and let us know if it's ok..

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

how to add the text at touch position. 8 years 1 month ago #10350

  • ankur123987
  • ankur123987's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Available as freelancer (ex website to app 30min)
  • Posts: 97
  • Thank you received: 0
Hi Davide ,
page.AddContent(content, true) always return true as i can see output at screen .but its not pointed to correct location at pdf

Thanks for modified code .i pass the parameter of touch points in your code .this touch coordinates work fine with edit box.

PageContent content = new PageContent();
content.Create();//create content, do not forget.
content.GSSave();
Matrix mat = new Matrix( 1, 1, x, y);
content.GSSetMatrix(mat);
mat.Destroy();

Please help

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

  • Page:
  • 1
  • 2
Powered by Kunena Forum