• Document2PDF

    By Leif J. 2 decades ago

    Hi,



    Are it not possible to take the document I have open and create a PDF from that ?



    /Leif

    • By Dmytro Pastovenskyi 2 decades ago

      this database only example how to create PDF file.

      We have to work more with it to make it better.



      So it is only demonstration how to do it… just good way.

    • Unicode/non-us characters

      By Lubomir Cerny 2 decades ago

      To be able to export non-us characters, you should consider to setup default font to unicode. Use code like:



      BaseFont verdana = BaseFont.createFont("c:\windows\fonts\verdana.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);



      The point is "BaseFont.IDENTITY_H" option.

      Then output to pdf will go like:



      Font font = new Font(verdana, 12);

      Font font_title = new Font(verdana, 24);



      pdfDoc.add(new Paragraph ("Records summanry",font_title));

      pdfDoc.add(new Paragraph ("Goods name:" + strName,font));



      This will use verdana windows ttf file, set unicode and prints big "Records summary" + normal "Goods name".