Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-1705

can not Write Hebrew and Chinese word into a PDF

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.8.1
    • Fix Version/s: 2.0.0
    • Component/s: Writing
    • Labels:
      None

      Description

      Can not write Hebrew or Chinese into PDF file. It shows unreadable codes. If it does not support with latest version, please comments me. Thank you.

      PDDocument document = new PDDocument();
      PDPage page = new PDPage();
      document.addPage( page );
      PDFont font = PDTrueTypeFont.loadTTF(document, "pdf/simkai.ttf");
      PDPageContentStream contentStream = new PDPageContentStream(document, page);
      contentStream.beginText();
      contentStream.setFont( font, 12 );
      contentStream.moveTextPositionByAmount( 100, 700 );
      contentStream.drawString("中文 = Chinese");
      contentStream.drawString("Hebrew= העתק");
      contentStream.endText();
      contentStream.close();
      document.save( "pdf/Hello World.pdf");
      document.close();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                meiyuanxuun meiyuanxun
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: