FPDF and Trademark symbol

Does anyone know what I might need to change in order to insert a special character like a trademark symbol into a PDF using fpdf? I can’t imagine someone hasn’t seen this before given that trademark and copyright symbols are so common. When I append it as chr(174) at the end of a string and then add to the file using cell() I get the output seen in the attached image. Here is what I’m attempting:

dim nameTitle as String = currUser.name+" " + chr(174) Cell(350,20,nameTitle)

The output is: ®

And in case that doesn’t show up correctly, here’s an screen grab. The “P” is correct (in the screen grab it’s part of the name) and so is the trademark symbol.

depending on the complexity of the PDF documents you need/want to create…
you might take a look at my gPDF class.
It uses the exact same syntax as the Xojo Canvas/Graphics object, so it takes a slightly different approach as compared to other PDF generators…

www.rdS.com/gpdf

The PDF library must map characters to glyphs correctly.

Maybe time to check the MBS Xojo DynaPDF Plugin?

And for writing, you just need the smallest license.

[quote=366224:@Dave S]depending on the complexity of the PDF documents you need/want to create…
you might take a look at my gPDF class.
It uses the exact same syntax as the Xojo Canvas/Graphics object, so it takes a slightly different approach as compared to other PDF generators…

www.rdS.com/gpdf[/quote]

Hi Dave, I may take a look if it comes to it but my problem now is that this is a completed project and my customer has come back and asked for a trademark symbol. So I’m trying to avoid a rewrite of the whole PDF creation piece of this just because I can’t insert a trademark symbol :confused:

what if you just typed it? ™
option-2 on the mac keyboard

dim nameTitle as String = currUser.name+" ™"

try to generate a pdf file with any text editor, with only the symbol you need in it
and then check the pdf output using some text editor like textwrangler.

in a PDF file it is

(\\231) Tj

Thanks, Dave. That did it (although I was using the “registered” symbol but calling it the trademark symbol). I just had to bypass the cell() method from fpdf because adds slashes to the backslash. So I’m adding the \256 (®) to the fpdf.buffer manually. It’s dirty but it will work for now.

Ben