com.dynamicpdf.api.PdfResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dynamicpdf-api Show documentation
Show all versions of dynamicpdf-api Show documentation
A Java Client API that uses the DynamicPDF API to create, merge, split, form fill, stamp, secure/encrypt PDF documents.
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";
}
}