DynamicPDF by ceTe Software

com.cete.dynamicpdf.imaging
Class JpegImageData

java.lang.Object
  extended by com.cete.dynamicpdf.Resource
      extended by com.cete.dynamicpdf.imaging.ImageData
          extended by com.cete.dynamicpdf.imaging.JpegImageData

public class JpegImageData
extends ImageData

Class represents the data of a JPEG image.

Licensing:
This class is a DynamicPDF Generator Professional Edition feature. One of the following licenses is required for non-evaluation usage:


Constructor Summary
JpegImageData(java.lang.String filePath)
          Initializes a new instance of the JpegImageData class.
 
Method Summary
 void draw(DocumentWriter writer)
          Draws the JPEG image data to the given DocumentWriter object.
 int getHeight()
          Gets the height of the JPEG image.
 int getRequiredPdfObjects()
          Gets the number of PDF objects required by the JPEG image data.
 float getScaleX()
          Gets the X scale of the image.
 float getScaleY()
          Gets the X scale of the image.
 int getWidth()
          Gets the width of the JPEG image.
static boolean isValid(byte[] header)
          Returns a value indicating if the provides file header is valid for a JPEG image.
static boolean isValid(java.lang.String fileExtension)
          Returns a value indicating if the provides file extension is valid for a JPEG image.
 
Methods inherited from class com.cete.dynamicpdf.imaging.ImageData
draw, getHorizontalDpi, getImage, getImage, getInterpolate, getPage, getPage, getPointHeight, getPointWidth, getResourceType, getVerticalDpi, setInterpolate
 
Methods inherited from class com.cete.dynamicpdf.Resource
getUid, newUid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JpegImageData

public JpegImageData(java.lang.String filePath)
              throws java.io.FileNotFoundException
Initializes a new instance of the JpegImageData class.

Throws:
ImageParsingException - If the JPEG File is invalid.
java.io.FileNotFoundException - If physical file path of the image is not found.
Parameters:
filePath - Physical file path of the image.
See Also:
JpegImageData
Method Detail

isValid

public static boolean isValid(java.lang.String fileExtension)
Returns a value indicating if the provides file extension is valid for a JPEG image.

Parameters:
fileExtension - String value containing file extension.
Returns:
true, if the file extension is valid. Otherwise false.

isValid

public static boolean isValid(byte[] header)
Returns a value indicating if the provides file header is valid for a JPEG image.

Parameters:
header - Contains the image header bytes.
Returns:
true, if the file extension is valid. Otherwise false.

getRequiredPdfObjects

public int getRequiredPdfObjects()
Gets the number of PDF objects required by the JPEG image data.

Overrides:
getRequiredPdfObjects in class Resource
Returns:
the number of PDF objects required by the JPEG image data.

getWidth

public int getWidth()
Gets the width of the JPEG image.

Specified by:
getWidth in class ImageData
Returns:
the width of the JPEG image.

getHeight

public int getHeight()
Gets the height of the JPEG image.

Specified by:
getHeight in class ImageData
Returns:
the height of the JPEG image.

getScaleX

public float getScaleX()
Gets the X scale of the image.

Specified by:
getScaleX in class ImageData
Returns:
the X scale of the image.

getScaleY

public float getScaleY()
Gets the X scale of the image.

Specified by:
getScaleY in class ImageData
Returns:
the X scale of the image.

draw

public void draw(DocumentWriter writer)
Draws the JPEG image data to the given DocumentWriter object.

Specified by:
draw in class Resource
Parameters:
writer - DocumentWriter object to receive the JPEG image data's output.
See Also:
DocumentWriter

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.07 for Java generated on Aug 12, 2020
© Copyright 2020, ceTe Software