Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8288209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:14:09+00:00 2026-06-08T12:14:09+00:00

What I need Special characters to work on FPDF, either working with hardcoded strings

  • 0

What I need

Special characters to work on FPDF, either working with hardcoded strings or results from a DB query

What I’m using

As suggested in some questions here at SO, I’m using tFPDF to get special-characters to work.

Problem

It works on the strings that are retrieved from an MySQL database but not on my hardcoded strings.

Inputs Example

DB string:
image
Hardcoded equivalent:
Operação

Outputs Example

enter image description here

As you can see, the filled cell is the hardcoded one, and the non-filled is the result from the DB.

Code

For hardcode output of table header cell, i’m using the following code:

$pdf->Cell($wO,$h,'Operação',1,0,'C',true);

To output the DB result, I’m using a similar code:

$pdf->Cell($wO,$h,$oper,1,0,'C',$fill);

I already tried utf8_encode but it only gives me rectangles instead of the characters…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:14:10+00:00Added an answer on June 8, 2026 at 12:14 pm

    I solved this by using Arial font on the table headers and print the cell like this so that it assumes the special character:

    $pdf->Cell($wO,$h,'Opera'.chr(231).chr(227).'o',1,0,'C',true);
    

    Then, I put the special font named DejaVu again so that it places the special characters on the DB results.
    Hope it helps anyone with the same problem, I followed this example and got the char number…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to escape some special characters from a JS string, but I can
I need some effective way to escape all special characters in string.For example, my
I need a function that will clean a strings' special characters. I do NOT
I need to pass strings that may contain special characters to a Javascript function
I have a e-mail address validator but I need to add special characters as
I need a regular expression that will not allow multiple special characters in a
I need your help with this one again. I want to send special characters
I need to pass '+' via the QueryString . some special character can be
I need to create an alias for one exact page which unfortunately special characters
i'm using sanitize::paranoid on a string but i need to exclude a few special

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.