Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Dec 2008
    Posts
    120
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Question Line break (newline) in MS-Word

    Hi,

    I am using phpWord to generate word documents, the only problem is I dont know how to add a line break, does anyone know what is the character for line break, so for example I have the following text:

    Code:
    This is
    a
    Test Text
    Now if I enter that into the word document, this is what I get in the word document:

    Code:
    This is a Test Text
    I really am after a character that I can use that will generate a new line, please note I have tried all of the following characters and they don't work
    • \n
    • \r\n
    • \n\r
    • \v


    Would really appreciate if some one could help.

    Thanks

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    according to the manual "Calling the addText() function will always create a line break. This happens because the DOCX Writer creates a paragraph for each text element."

  • #3
    Regular Coder
    Join Date
    Dec 2008
    Posts
    120
    Thanks
    15
    Thanked 2 Times in 2 Posts
    Yes I know that but the problem is I am using a template. and I must use the setText method. Thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •