code: @SuppressWarnings("WeakerAccess")
  	public void registerFont(String fontName, InputStream fontStream) throws IOException {
  		File fontFile = File.createTempFile("pdfboxgfx2dfont", ".ttf");
  		FileOutputStream out = new FileOutputStream(fontFile);
  		try {
  			IOUtils.copy(fontStream, out);
  		} finally {
  			out.close();
  		}
  		fontFile.deleteOnExit();
  		tempFiles.add(fontFile);
  		registerFont(fontName, fontFile);
  	}
docs: Register a font. If possible, try to use a font file, i.e.
  {@link #registerFont(String,File)}. This method will lead to the creation of
  a temporary file which stores the font data.
  
  @param fontName
  the name of the font to use. If null, the name is taken from the
  font.
  @param fontStream
  the input stream of the font. This file must be a ttf/otf file!
  You have to close the stream outside, this method will not close
  the stream.