title: Using PDFBox to write UTF-8 encoded strings to a PDF
body: <p>I am having trouble writing unicode characters out to a PDF using PDFBox. Here is some sample code that generates garbage characters instead of outputting "š". What can I add to get support for UTF-8 strings?</p>
  
  <pre><code>PDDocument document = new PDDocument();
  PDPage page = new PDPage();
  document.addPage(page);
  PDPageContentStream contentStream = new PDPageContentStream(document, page);
  
  PDType1Font font = PDType1Font.HELVETICA;
  contentStream.setFont(font, 12);
  contentStream.beginText();
  contentStream.moveTextPositionByAmount(100, 400);
  contentStream.drawString("š");
  contentStream.endText();
  contentStream.close();
  document.save("test.pdf");
  document.close();
  </code></pre>