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

Seperate arabic character issue

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.3
    • None
    • None
    • None
    • Android studio

    Description

      Hello
      I port PDFBox 2.0.3 to Android.It works well.But my problem is seperate arabic character in created pdf document.how do i fix it?

      My Code :

      try {
                          PDDocument document = new PDDocument();
                          
                          PDFont font =  PDType0Font.load(document, getAssets().open("fonts/tahoma.ttf") );
      
                          for (int i = 0; i < images.size(); i++) {
                              if (!images.get(i).equals("")) {
                                  PDPage page = new PDPage(PDRectangle.A4);
                                  Log.e("debug","code pos 1");
                                  // page.set
                                  document.addPage(page);
      
                                  PDPageContentStream contentStream = new PDPageContentStream(document, page);
      
                                  contentStream.beginText();
                                  contentStream.setFont(font, 12);
                                  contentStream.setLeading(12 * 1.2);
      
                                  contentStream.newLineAtOffset(50, 600);
                                  contentStream.showText("اسلام علیکم 1"); // printed : ا س ل ا م ع ل ی ک م 1
                                  contentStream.newLine();
      							
                                  contentStream.endText();
      
                                  contentStream.close();
      							....
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              javadvjj javad
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: