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

com.dynamicpdf.api.PdfResource Maven / Gradle / Ivy

Go to download

A Java Client API that uses the DynamicPDF API to create, merge, split, form fill, stamp, secure/encrypt PDF documents.

There is a newer version: 1.10.1
Show newest version
package com.dynamicpdf.api;

import java.io.InputStream;

/**
 * Represents a pdf resource.
 */
public class PdfResource extends Resource {

	private ResourceType resourceType = ResourceType.PDF;

	/**
	 * Initializes a new instance of the PdfResource class.
	 * @param filePath The pdf file path.
	 * @param resourceName The name of the resource.
	 */
	public PdfResource(String filePath, String resourceName) {
		super(filePath, resourceName);
	}

	/**
	 * Initializes a new instance of the PdfResource class.
	 * @param filePath The pdf file path.
	 */
	public PdfResource(String filePath) {
		super(filePath, null);
	}

	/**
	 * Initializes a new instance of the PdfResource class.
	 * @param value The byte array of the pdf file.
	 * @param resourceName The name of the resource.
	 */
	public PdfResource(byte[] value, String resourceName) {
		super(value, resourceName);
	}

	/**
	 * Initializes a new instance of the PdfResource class.
	 * @param value The byte array of the pdf file.
	 */
	public PdfResource(byte[] value) {
		super(value, null);
	}

	/**
	 * Initializes a new instance of the PdfResource class.
	 * @param data The stream of the pdf file.
	 * @param resourceName The name of the resource.
	 */
	public PdfResource(InputStream data, String resourceName) {
		super(data, resourceName);
	}

	/**
	 * Initializes a new instance of the PdfResource class.
	 * @param data The stream of the pdf file.
	 */
	public PdfResource(InputStream data) {
		super(data, null);
	}    

	ResourceType getType() {
		return resourceType;
	}

	String getFileExtension() {
		return ".pdf";
	}

	String getMimeType() {
		return "application/pdf";
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy