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

public Class EmbeddedFiles

extends Object
Class Inheritance
Imports
java.io.ByteArrayInputStream, .IOException, java.nio.charset.StandardCharsets, java.util.ArrayList, .Collections, .GregorianCalendar, .List, org.apache.pdfbox.pdmodel.PDDocument, .PDDocumentNameDictionary, .PDEmbeddedFilesNameTreeNode, .PDPage, .PDPageContentStream, .PageMode, org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification, .PDEmbeddedFile, org.apache.pdfbox.pdmodel.font.PDFont, .PDType1Font, .Standard14Fonts.FontName

This is an example that creates a simple document and embeds a file into it..
Author
Ben Litchfield

Constructor Summary

AccessConstructor and Description
private
EmbeddedFiles()

Constructor.

Method Summary

Modifier and TypeMethod and Description
public void
doIt(String
The file to write the PDF to.
file
)

create the second sample document from the PDF file format specification.

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

This will create a hello world PDF document with an embedded file.

private void
usage()

This will print out a message telling how to use this example.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

EmbeddedFilesback to summary
private EmbeddedFiles()

Constructor.

Method Detail

doItback to summary
public void doIt(String file) throws IOException

create the second sample document from the PDF file format specification.

Parameters
file:String

The file to write the PDF 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 hello world PDF document with an embedded file.
see usage() for commandline

Parameters
args:String[]

Command line arguments.

usageback to summary
private void usage()

This will print out a message telling how to use this example.