Class RubberStampWithImage
java.lang.Object
org.apache.pdfbox.examples.pdmodel.RubberStampWithImage
This is an example on how to add a rubber stamp annotation with an image to pages of a PDF
document. To add a normal image, use the AddImageToPDF.java example.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidappendRawCommands(OutputStream os, String commands) voidAdd a rubber stamp with an jpg image to every page of the given document.private voiddrawXObject(PDImageXObject xobject, PDResources resources, OutputStream os, float x, float y, float width, float height) static voidThis creates an instance of RubberStampWithImage.private voidusage()This will print the usage for this example.
-
Field Details
-
SAVE_GRAPHICS_STATE
- See Also:
-
RESTORE_GRAPHICS_STATE
- See Also:
-
CONCATENATE_MATRIX
- See Also:
-
XOBJECT_DO
- See Also:
-
SPACE
- See Also:
-
FORMATDECIMAL
-
-
Constructor Details
-
RubberStampWithImage
public RubberStampWithImage()
-
-
Method Details
-
doIt
Add a rubber stamp with an jpg image to every page of the given document.- Parameters:
args- the command line arguments- Throws:
IOException- an exception is thrown if something went wrong
-
drawXObject
private void drawXObject(PDImageXObject xobject, PDResources resources, OutputStream os, float x, float y, float width, float height) throws IOException - Throws:
IOException
-
appendRawCommands
- Throws:
IOException
-
main
This creates an instance of RubberStampWithImage.- Parameters:
args- The command line arguments.- Throws:
IOException- If there is an error parsing the document.
-
usage
private void usage()This will print the usage for this example.
-