Class CmsPdfConverter

java.lang.Object
org.opencms.pdftools.CmsPdfConverter

public class CmsPdfConverter extends Object
This class uses the flying-saucer library to convert an XHTML document to a PDF document.

  • Constructor Details

  • Method Details

    • convertXhtmlToPdf

      public byte[] convertXhtmlToPdf(CmsObject cms, byte[] xhtmlData, String uri) throws Exception
      Converts XHTML data to a PDF document.

      Parameters:
      cms - the current CMS context
      xhtmlData - the XHTML as a byte array
      uri - the uri to use for error messages in the XML parser
      Returns:
      the PDF data as a byte array
      Throws:
      Exception - if something goes wrong