All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.formkiq.vision.pdf.PdfImage Maven / Gradle / Ivy

/*
 * Copyright (C) 2018 FormKiQ Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.formkiq.vision.pdf;

import org.apache.commons.lang3.Range;
import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;

import com.formkiq.vision.document.DocumentImage;

/**
 * PDF Image Holder.
 *
 */
public class PdfImage implements DocumentImage {

	/** {@link String}. */
	private String imageName;
    /** {@link PDImageXObject}. */
    private byte[] image;
    /** float. */
    private Range x;
    /** float. */
    private Range y;
    /** Image Width. */
    private float width;
    /** Image Height. */
    private float height;

    /**
     * constructor.
     */
    public PdfImage() {
    }

    /**
     * @return byte[]
     */
    public byte[] getImage() {
        return this.image.clone();
    }

    /**
     * @param object byte[]
     */
    public void setImage(final byte[] object) {
        this.image = object.clone();
    }

    /**
     * @return {@link Range}
     */
    public Range getX() {
        return this.x;
    }

    /**
     * Set Range.
     * @param range {@link Range}
     */
    public void setX(final Range range) {
        this.x = range;
    }

    /**
     * @return {@link Range}
     */
    public Range getY() {
        return this.y;
    }

    /**
     * Set Range.
     * @param range {@link Range}
     */
    public void setY(final Range range) {
        this.y = range;
    }

    /**
     * @return {@link String}
     */
	public String getImageName() {
		return this.imageName;
	}

	/**
	 * @param name {@link String}
	 */
	public void setImageName(final String name) {
		this.imageName = name;
	}

	/**
	 * @return float
	 */
	public float getWidth() {
		return this.width;
	}

	/**
	 * @param imagewidth float
	 */
	public void setWidth(final float imagewidth) {
		this.width = imagewidth;
	}

	/**
	 * @return float
	 */
	public float getHeight() {
		return this.height;
	}

	/**
	 * @param imageheight float
	 */
	public void setHeight(final float imageheight) {
		this.height = imageheight;
	}

	@Override
	public String getImagetype() {
		return "png";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy