Class ContentByteUtils


  • public class ContentByteUtils
    extends java.lang.Object
    Since:
    5.0.1
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ContentByteUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] getContentBytesForPage​(PdfReader reader, int pageNum)
      Gets the content bytes of a page from a reader
      static byte[] getContentBytesFromContentObject​(PdfObject contentObject)
      Gets the content bytes from a content object, which may be a reference a stream or an array.
      • Methods inherited from class java.lang.Object

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

      • ContentByteUtils

        private ContentByteUtils()
    • Method Detail

      • getContentBytesFromContentObject

        public static byte[] getContentBytesFromContentObject​(PdfObject contentObject)
                                                       throws java.io.IOException
        Gets the content bytes from a content object, which may be a reference a stream or an array.
        Parameters:
        contentObject - the object to read bytes from
        Returns:
        the content bytes
        Throws:
        java.io.IOException
      • getContentBytesForPage

        public static byte[] getContentBytesForPage​(PdfReader reader,
                                                    int pageNum)
                                             throws java.io.IOException
        Gets the content bytes of a page from a reader
        Parameters:
        reader - the reader to get content bytes from
        pageNum - the page number of page you want get the content stream from
        Returns:
        a byte array with the effective content stream of a page
        Throws:
        java.io.IOException
        Since:
        5.0.1