public class ExtractAttachments extends AbstractTool
arguments, internalFrame, MENU_EXECUTE, MENU_EXECUTE_PRINT, MENU_EXECUTE_PRINT_SILENT, MENU_EXECUTE_SHOW, menuoptions, versionsarray
Constructor and Description |
---|
ExtractAttachments()
Constructs a ExtractAttachements object.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createFrame()
Creates the internal frame.
|
void |
execute()
Executes the tool (in most cases this generates a PDF file).
|
protected File |
getDestPathPDF()
Gets the PDF file that should be generated (or null if the output isn't a PDF file).
|
static void |
main(String[] args)
Extract the attachments of a PDF.
|
static void |
unpackFile(PdfReader reader,
PdfDictionary filespec,
String outPath)
Unpacks a file attachment.
|
void |
valueHasChanged(AbstractArgument arg)
Indicates that the value of an argument has changed.
|
actionPerformed, addVersion, getArguments, getInternalFrame, getMenubar, getUsage, getValue, setArguments, setInternalFrame, setMainArguments, setMenubar
public ExtractAttachments()
protected void createFrame()
AbstractTool
createFrame
in class AbstractTool
AbstractTool.createFrame()
public void execute()
AbstractTool
execute
in class AbstractTool
AbstractTool.execute()
public void valueHasChanged(AbstractArgument arg)
AbstractTool
valueHasChanged
in class AbstractTool
arg
- StringArgumentAbstractTool.valueHasChanged(com.lowagie.toolbox.arguments.AbstractArgument)
public static void main(String[] args)
args
- String[]protected File getDestPathPDF() throws InstantiationException
AbstractTool
getDestPathPDF
in class AbstractTool
InstantiationException
AbstractTool.getDestPathPDF()
public static void unpackFile(PdfReader reader, PdfDictionary filespec, String outPath) throws IOException
reader
- The object that reads the PDF documentfilespec
- The dictionary containing the file specificationsoutPath
- The path where the attachment has to be writtenIOException
Copyright © 2013 InProTopia Corporation. All Rights Reserved.