• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help required regarding special character representation in PDF generated using FOP

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using FOP version 0.20.5 for generating a PDF. Whenever a special character is encountered, they are getting displayed as hash ("#") in the PDF. Can anyone give an idea how to go about this.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which font are you using in the generated PDF? Does that font have the special character your input file uses?
 
anekh sunamo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We are using sans-serif font. We are getting the special char from word document. for example: "This is � the special char" The hypen we get from word document is not the mormal ANSI hypen. This seems to be a double byte char. And the Hypen is displayed as # in PDF. We are using FOP.jar for pdf generation.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. So apparently the default sans-serif font (sans-serif is just a "family" of fonts, if you weren't aware of that) used by FOP doesn't handle your specific special character too well. Could you try another font?
 
anekh sunamo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We tried with fonts like Arial, Courier but the special characters remained same.
Now we passed UTF-8 encoding to the InputStreamReader. Looks like it works but generates an extra character - �.
 
A sonic boom would certainly ruin a giant souffle. But this tiny ad would protect it:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic