i cant print arabic characters
defualt fonts dont support arabic characters
but i find this from pdfbox site
Hello World Using a TrueType Font
This small sample shows how to create a new document and print the text “Hello World” using a TrueType font.
B4X:
// Create a document and add a page to it
PDDocument document = new PDDocument();
PDPage page = new PDPage();
document.addPage( page );
// Create a new font object by loading a TrueType font into the document
PDFont font = PDTrueTypeFont.loadTTF(document, "Arial.ttf");
// Start a new content stream which will "hold" the to be created content
PDPageContentStream contentStream = new PDPageContentStream(document, page);
// Define a text content stream using the selected font, moving the cursor and drawing the text "Hello World"
contentStream.beginText();
contentStream.setFont( font, 12 );
contentStream.moveTextPositionByAmount( 100, 700 );
contentStream.drawString( "Hello World" );
contentStream.endText();
// Make sure that the content stream is closed:
contentStream.close();
// Save the results and ensure that the document is properly closed:
document.save( "Hello World.pdf");
document.close();