Top Description Constructors Methods
org.apache.pdfbox.examples.pdmodel

public Class CreateGradientShadingPDF

extends Object
Class Inheritance
Imports
java.io.IOException, .OutputStream, javax.imageio.stream.MemoryCacheImageOutputStream, org.apache.pdfbox.cos.COSArray, .COSDictionary, .COSInteger, .COSName, .COSNumber, .COSStream, org.apache.pdfbox.pdmodel.PDDocument, .PDPage, .PDPageContentStream, .PDPageContentStream.AppendMode, org.apache.pdfbox.pdmodel.common.function.PDFunctionType2, org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB, org.apache.pdfbox.pdmodel.graphics.shading.PDShading, .PDShadingType2, .PDShadingType3, .PDShadingType4

This example creates a PDF with type 2 (axial) and type 3 (radial) shadings with a type 2 (exponential) function, and a type 4 (gouraud triangle shading) without function.
Author
Tilman Hausherr

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
create(String
The name of the file to write to.
file
)

This will create the PDF and write the contents to a file.

public static void
main(String[]
The command line arguments.
args
)

This will create a blank document.

private static void
usage()

This will print the usage of this class.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

CreateGradientShadingPDFback to summary
public CreateGradientShadingPDF()

Method Detail

createback to summary
public void create(String file) throws IOException

This will create the PDF and write the contents to a file.

Parameters
file:String

The name of the file to write to.

Exceptions
IOException:
If there is an error writing the data.
mainback to summary
public static void main(String[] args) throws IOException

This will create a blank document.

Parameters
args:String[]

The command line arguments.

Exceptions
IOException:
If there is an error writing the document data.
usageback to summary
private static void usage()

This will print the usage of this class.