how to use i18n in pdf using itext in java -


I am using Hindi language to display the header content of the table in pdf, but this is the header part of the table Displays empty cell in / P>

I have created the following:

  HTTP server response response = servletActioncontext.getresons (); Document document = new document (); BytereanOutOperputStream buffer = new byteOnputstream (); PdfWriter Author = PdfWriter.getInstance (document, buffer); Writer.setBoxSize ("art", new rectangle (36, 54, 55 9, 788)); Document.open (); PDFPTable lineItemTable = new PDFPTable (cellvel); LineItemTable.setHeaderRows (1); PDFPCL Number 1 = New PDFPCL (new phrase ("no", bold_image)); Num1.setHorizontalAlignment (Element.ALIGN_CENTER); Num1.setBackgroundColor (BaseColor.LIGHT_GRAY); LineItemTable.addCell (number1); PDFPCL Lineline = new PDFPCL (new phrase ("")); Linewol = new PDFPCL (new phrase (HindiEtitin name, bold_nimel)); Lineval.setHorizontalAlignment (Element.ALIGN_CENTER); Lineval.setBackgroundColor (BaseColor.LIGHT_GRAY); LineItemTable.addCell (lineval); Document.add (lineItemTable); Document.close (); Response.setContentType ("application / PDF; charset = ISO-8859-1"); Response.setHeader ("content-configuration", "attachment; file name = invoice -" + invNumber + "pdf."); . Response.getOutputStream () write (buffer.toByteArray ());  

This is my sample code, can you please help me please thank you in advance

call

  writer.close (); Document.close (); Response.setContentType ("application / PDF");  

The authors of some structures in the document are stopping the round. But I have seen many examples where it has not been done. So I'm not sure.

The content type is for binary and does not require encoding.

On error: Choose a Unicode font, IDENTITY_H:

  last string font = "c: / windows / ... .tf"; BaseFont BF = BaseFonts.CourtFont (font, basefont.indentti_h, basefont.mbeded); Document.add (new paragraph ("font:" + bf.getPostscriptFontName (+) "with encoding:" + bf.getEncoding ());  

Here is an embedded font, so there will be no problem in favor of the recipient. This is a book excerpt.

For a better browser experience:

  byte [] bytes = buffer. To Batere (); Response.setContentLength (bytes.length); . Write Response.getOutputStream () (byte);  

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -