Recent

Author Topic: [Solved] TPdfDoc and special characters  (Read 687 times)

cpalx

  • Hero Member
  • *****
  • Posts: 753
[Solved] TPdfDoc and special characters
« on: September 19, 2019, 03:59:56 pm »
I try to do this:

   MyPDFDOC.Canvas.TextOut( 75,75, 'El día de hoy' );       

and when i see the final PDF, the character  " í  " doesnt display, instead of  appers garbage characters

Any idea how to solve?


« Last Edit: September 19, 2019, 04:40:42 pm by cpalx »

jujibo

  • Full Member
  • ***
  • Posts: 114
Re: TPdfDoc and special characters
« Reply #1 on: September 19, 2019, 04:29:21 pm »
I guess you are talking about PowerPDF.

You must convert string to cp1252 codepage. https://lazarus-ccr.sourceforge.io/docs/lazutils/lconvencoding/utf8tocp1252.html

Try:

   MyPDFDOC.Canvas.TextOut( 75,75, UTF8ToCP1252('El día de hoy'));   

cpalx

  • Hero Member
  • *****
  • Posts: 753
Re: TPdfDoc and special characters
« Reply #2 on: September 19, 2019, 04:40:19 pm »
Thanks, it solves the problem

 

TinyPortal © 2005-2018