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

TOPIC:

how to use DrawText for multiline text 8 years 3 months ago #10005

  • gabmor
  • gabmor's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 17
  • Thank you received: 0
Hi, I successfully use the draw text method por a single but when the text has two or more lines draw the text on the same line how can I do this?.

this is my code
Document.DocFont docFont = m_doc.NewFontCID("Roboto-Regular", 8);//embed font to PDF file
            Page page = m_doc.GetPage(0);
            page.ObjsStart();

            ResFont resFont = page.AddResFont(docFont);
            PageContent content = new PageContent();
            content.Create();
            content.TextBegin();
            content.TextSetFont(resFont, 15);
            content.SetFillColor(Color.BLACK);
            content.TextSetRenderMode(0); // fill
            content.TextMove(50, 700);
            content.DrawText(largeText);
            content.TextEnd();

            page.AddContent(content, false);
            PDFVPage vpage = m_reader.getLayout().vGetPage(0);
            m_reader.getLayout().vRenderSync(vpage);

            content.Destroy();
            page.Close();

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

how to use DrawText for multiline text 8 years 3 months ago #10024

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
plz try string like "line1 \n line2."

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

  • Page:
  • 1
Powered by Kunena Forum