Class CmsPdfConverter


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

    • Constructor Summary

      Constructors 
      Constructor Description
      CmsPdfConverter()
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] convertXhtmlToPdf​(CmsObject cms, byte[] xhtmlData, java.lang.String uri)
      Converts XHTML data to a PDF document.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • convertXhtmlToPdf

        public byte[] convertXhtmlToPdf​(CmsObject cms,
                                        byte[] xhtmlData,
                                        java.lang.String uri)
                                 throws java.lang.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:
        java.lang.Exception - if something goes wrong