java.lang.Object
com.lowagie.toolbox.AbstractTool
com.lowagie.toolbox.plugins.ExtractAttachments
- All Implemented Interfaces:
ActionListener,EventListener
This tool lets you extract the attachments of a PDF.
- Since:
- 2.1.1 (imported from itexttoolbox project)
-
Field Summary
Fields inherited from class com.lowagie.toolbox.AbstractTool
arguments, internalFrame, MENU_EXECUTE, MENU_EXECUTE_PRINT, MENU_EXECUTE_PRINT_SILENT, MENU_EXECUTE_SHOW, menuoptions, versionsarray -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCreates the internal frame.voidexecute()Executes the tool (in most cases this generates a PDF file).protected FileGets the PDF file that should be generated (or null if the output isn't a PDF file).static voidExtract the attachments of a PDF.static voidunpackFile(com.lowagie.text.pdf.PdfReader reader, com.lowagie.text.pdf.PdfDictionary filespec, String outPath) Unpacks a file attachment.voidIndicates that the value of an argument has changed.Methods inherited from class com.lowagie.toolbox.AbstractTool
actionPerformed, addVersion, getArguments, getInternalFrame, getMenubar, getUsage, getValue, setArguments, setInternalFrame, setMainArguments, setMenubar
-
Constructor Details
-
ExtractAttachments
public ExtractAttachments()Constructs a ExtractAttachements object.
-
-
Method Details
-
main
Extract the attachments of a PDF.- Parameters:
args- String[]
-
unpackFile
public static void unpackFile(com.lowagie.text.pdf.PdfReader reader, com.lowagie.text.pdf.PdfDictionary filespec, String outPath) throws IOException Unpacks a file attachment.- Parameters:
reader- The object that reads the PDF documentfilespec- The dictionary containing the file specificationsoutPath- The path where the attachment has to be written- Throws:
IOException- on error
-
createFrame
protected void createFrame()Description copied from class:AbstractToolCreates the internal frame.- Specified by:
createFramein classAbstractTool- See Also:
-
execute
public void execute()Description copied from class:AbstractToolExecutes the tool (in most cases this generates a PDF file).- Specified by:
executein classAbstractTool- See Also:
-
valueHasChanged
Description copied from class:AbstractToolIndicates that the value of an argument has changed.- Specified by:
valueHasChangedin classAbstractTool- Parameters:
arg- StringArgument- See Also:
-
getDestPathPDF
Description copied from class:AbstractToolGets the PDF file that should be generated (or null if the output isn't a PDF file).- Specified by:
getDestPathPDFin classAbstractTool- Returns:
- File
- Throws:
InstantiationException- on error- See Also:
-