- Posts: 97
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
how to add the text at touch position.
- ankur123987
-
Topic Author
- Offline
- Premium Member
-
- Available as freelancer (ex website to app 30min)
Less
More
10 years 3 weeks ago #10341
by ankur123987
how to add the text at touch position. was created by ankur123987
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();
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();
10 years 3 weeks ago #10345
by Davide
Replied by Davide on topic how to add the text at touch position.
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..
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..
- ankur123987
-
Topic Author
- Offline
- Premium Member
-
- Available as freelancer (ex website to app 30min)
Less
More
- Posts: 97
- Thank you received: 0
10 years 3 weeks ago #10347
by ankur123987
Replied by ankur123987 on topic how to add the text at touch position.
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
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
10 years 3 weeks ago #10348
by Davide
Replied by Davide on topic how to add the text at touch position.
Hi,
please answer my question : what does page.AddContent(content, true); return?
please answer my question : what does page.AddContent(content, true); return?
10 years 3 weeks ago #10349
by Davide
Replied by Davide on topic how to add the text at touch position.
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..
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..
- ankur123987
-
Topic Author
- Offline
- Premium Member
-
- Available as freelancer (ex website to app 30min)
Less
More
- Posts: 97
- Thank you received: 0
10 years 3 weeks ago #10350
by ankur123987
Replied by ankur123987 on topic how to add the text at touch position.
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
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
Time to create page: 0.480 seconds