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

Add Plane Text on PDF file

More
IP: 103.212.147.1 7 years 4 months ago #14353 by kross001
Hi,

I need a small help from your team to add Plane Text on PDF File.
Please help me.

Thanks
Kevin Ross
More
IP: 111.196.246.50 7 years 4 months ago #14354 by radaee
Replied by radaee on topic Add Plane Text on PDF file
OK, if you mean the Page Content Stream the codes like:
Code:
PageContent content = new PageContent(); content.Create();//create content, do not forget. //prepare to write texts content.GSSave(); mat = new Matrix( 1, 1, 80, 200 ); content.GSSetMatrix(mat); mat.Destroy(); //the font name must exists on font list, that initialized in Global.Init(); DocFont dfont = m_doc.NewFontCID("DroidSansFallback", 3 | 8);//bold-italic and embed in horizontal writing if(dfont == null) { dfont = m_doc.NewFontCID("Roboto-Regular", 3 | 8); if(dfont == null) dfont = m_doc.NewFontCID("DroidSans", 3 | 8); } ResFont rfont = page.AddResFont(dfont); content.TextBegin(); content.TextSetFont(rfont, 16);//set font and size content.SetFillColor(0x8000);//set fill color to black-green. content.SetStrokeColor(0x80);//set stroke color to black-red. content.TextSetCharSpace(0); content.TextSetWordSpace(0.2f); content.TextSetLeading(16); content.TextSetRenderMode(2);//fill and stroke content.TextSetHScale(120);//set horizontal scale content.DrawText("Hello word!\rNice to meet you!"); content.TextEnd(); content.GSRestore(); page.AddContent(content, true); content.Destroy(); page.Close();
if you mean annotation, you can using Page.AddAnnotEditbox() to add an editbox on page,
and then using Annotation.SetEditText() to set text value.
Time to create page: 0.391 seconds
Powered by Kunena Forum