DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
InputSource is = new InputSource(bais);
Document doc = builder.parse(is);
//Listener that will parse HTML header meta tags, and will set them to PDF document as meta data
PebblePDFCreationListener pdfListener = new PebblePDFCreationListener();
pdfListener.parseMetaTags(doc);
renderer.setListener(pdfListener);
renderer.setDocument(doc, null);
renderer.layout();
BufferedOutputStream bufferedOutput = new BufferedOutputStream(response.getOutputStream());