public class OutPdfArgs extends Object implements ArgsConfiguration, AutoCloseable
Constructor and Description |
---|
OutPdfArgs(String metavarIn,
boolean allowAppend) |
Modifier and Type | Method and Description |
---|---|
void |
addArguments(ArgumentParser parser)
Adds arguments that configure this
ArgsConfiguration to an
ArgumentParser |
void |
close()
Writes the content of the internal buffer to the output file.
|
void |
close(boolean success) |
File |
getFile() |
com.itextpdf.text.pdf.PdfStamper |
getPdfStamper() |
com.itextpdf.text.pdf.PdfStamper |
open(com.itextpdf.text.pdf.PdfReader pdfReader,
boolean signature,
char pdfVersion)
Returns a
PdfStamper associated with the internal buffer. |
void |
setDefaultFile(File file)
Set the target file if it has not been set by
setFromNamespace(Namespace) . |
void |
setFromNamespace(Namespace namespace)
Sets configuration values from a parsed
Namespace |
public OutPdfArgs(String metavarIn, boolean allowAppend)
public void addArguments(ArgumentParser parser)
ArgsConfiguration
ArgsConfiguration
to an
ArgumentParser
addArguments
in interface ArgsConfiguration
parser
- argument parser to add arguments topublic void setFromNamespace(Namespace namespace)
ArgsConfiguration
Namespace
setFromNamespace
in interface ArgsConfiguration
namespace
- the namespace with the argument valuespublic void setDefaultFile(File file)
setFromNamespace(Namespace)
.file
- the default file to be used in case none was specified by
setFromNamespace(Namespace)
public com.itextpdf.text.pdf.PdfStamper open(com.itextpdf.text.pdf.PdfReader pdfReader, boolean signature, char pdfVersion) throws OperationException
PdfStamper
associated with the internal buffer. Using a
buffer instead of an actual file means that the operation can be rolled
back completely, leaving the output file untouched. Call close()
to save the content of the buffer to the output file.pdfReader
- the input PdfReader
to operate onsignature
- shall we be signing the document?pdfVersion
- the last character of the PDF version number ('2' to
'7'), or '\0' to keep the original versionPdfStamper
that uses pdfReader as the sourceOperationException
- if an error occurspublic void close() throws OperationException
close
in interface AutoCloseable
OperationException
- if an error occurs when closing the
PdfStamper
or when writing to the output filepublic void close(boolean success) throws OperationException
OperationException
public com.itextpdf.text.pdf.PdfStamper getPdfStamper()
Copyright © 2015–2016 Hobrasoft s.r.o.. All rights reserved.