docs: public byte[] convertXhtmlToPdf(CmsObject cms, byte[] xhtmlData, String uri) throws Exception {
  
          Document doc = readDocument(xhtmlData);
          ITextRenderer renderer = new ITextRenderer();
          CmsPdfUserAgent userAgent = new CmsPdfUserAgent(cms);
          userAgent.setSharedContext(renderer.getSharedContext());
          renderer.getSharedContext().setUserAgentCallback(userAgent);
          renderer.setDocument(doc, uri);
          renderer.layout();
          ByteArrayOutputStream out = new ByteArrayOutputStream();
          renderer.createPDF(out);
          return out.toByteArray();
      }