Chinese characters in watermark not shown properly when iTextSharp is used. Some characters are shown as questionmark -


while adding watermark pdf file using itextsharp, chinese characters shown question marks.

i tried base font helvetica , tried options cp1252. tried giving font name present in windows fonts , supports chinese. every time question marks displayed in final pdf file instead of chinese characters.

helvetica contains limited number of latin glyphs. explained in itext documentation, can't use font create chinese characters. need font file, such arialuni.ttf , use create basefont object. use basefont object add string @ absolute position or create font object use in high-level object.

here examples:

  • how use font file such arialbd.ttf: encodingexample in case, you'd use arialuni.ttf , encoding identity_h
  • how use true type collection if don't have ttf file: ttcexample
  • how create string contains glyphs require different fonts: fontselectionexample

all these examples taken chapter 11 of book itext. if browse documentation, you'll find pdf examples, such font_selection.pdf, text4.pdf, etc...


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -