SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2012
    Location
    Northern New Brunswick, Atlantic Canada
    Posts
    44
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Control characters in PDFs

    I am generating a PDF file from a web page, using the FPDF add-on.

    Is there a way of embedding a bold-on command in a string variable, similar to a line-feed command.
    Obviously, <b> is not recognized when 'Writing' a string of text to the document.

    So, if /n is a line feed, is there an equivalent character for bold?

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,799
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by imillard View Post
    I am generating a PDF file from a web page, using the FPDF add-on.

    Is there a way of embedding a bold-on command in a string variable, similar to a line-feed command.
    Obviously, <b> is not recognized when 'Writing' a string of text to the document.

    So, if /n is a line feed, is there an equivalent character for bold?
    I am not aware of any character that does that. It shouldn't be too hard to split the string where the <b> and </b> occur and to output it as three separate strings turning the bold on and off in between using the FPDF font command.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2012
    Location
    Northern New Brunswick, Atlantic Canada
    Posts
    44
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes, that was my last resort.
    The file/form I am generating has 27 different text strings, which are displayed according to the users input.
    I suppose I'll have 45 strings now.

  4. #4
    Non-Member
    Join Date
    May 2013
    Location
    Australia
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Equivalent character for bold may be STRONG.Try it out. May be this works.

  5. #5
    SitePoint Enthusiast
    Join Date
    Sep 2012
    Location
    Northern New Brunswick, Atlantic Canada
    Posts
    44
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Unfortunately, that command set is not recognized by FPDF. The "manual" for that extension set (a very poor one) makes no mention of any bold commands that may be contained in a variable. It's nothing like the PHP 'echo' command.


Tags for this Thread

Bookmarks

Posting Permissions

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