Package org.jpedal.tools.pdfa
Class PdfA3Converter
java.lang.Object
org.jpedal.tools.pdfa.PdfA3Converter
Converts PDF files into valid PDF/A-3 files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe result of a conversion.static enumConformance level used during conversion. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new PDF/A-3 converter with the specified conformance level. -
Method Summary
Modifier and TypeMethodDescriptionConvert the given PDF file into a PDF/A-3 file, writing the result tooutput.Convert the given PDF file into a PDF/A-3 file, writing the result tooutput.intReturns the current threshold for which temporary files are written to disk rather than being stored in memory.static voidCommand-line entry point for the PDF/A-3 converter.voidsetMemoryCacheThreshold(int memoryCacheThreshold) Set the threshold at which temporary files created by the PDF/A-3 Converter which exceed this size will be written to the disk rather than stored in memory.
-
Constructor Details
-
PdfA3Converter
Create a new PDF/A-3 converter with the specified conformance level.- Parameters:
level- the conformance level to validate against- Throws:
IOException- See Also:
-
-
Method Details
-
setMemoryCacheThreshold
public void setMemoryCacheThreshold(int memoryCacheThreshold) Set the threshold at which temporary files created by the PDF/A-3 Converter which exceed this size will be written to the disk rather than stored in memory.Default:
58MB- Parameters:
memoryCacheThreshold- the threshold- See Also:
-
getMemoryCacheThreshold
public int getMemoryCacheThreshold()Returns the current threshold for which temporary files are written to disk rather than being stored in memory.- Returns:
- the current threshold for which temporary files are written to disk rather than being stored in memory
- See Also:
-
convert
Convert the given PDF file into a PDF/A-3 file, writing the result tooutput. The input file is assumed not to be password protected.- Parameters:
input- the PDF file to convertoutput- the file to write the converted PDF/A-3 file to- Returns:
- the result of the conversion
- Throws:
IOException- if the input file is invalid or an I/O error occurs during conversion- See Also:
-
convert
public PdfA3Converter.ConversionResult convert(File input, byte[] password, File output) throws IOException Convert the given PDF file into a PDF/A-3 file, writing the result tooutput.If the file cannot be made compliant, no output file is written and the returned result's list of issues will be non-empty.
- Parameters:
input- the PDF file to convertpassword- the password to decrypt the input file, ornullif it is not encryptedoutput- the file to write the converted PDF/A-3 file to- Returns:
- the result of the conversion
- Throws:
IOException- if the input file does not exist, is not a file, is not a PDF, or an I/O error occurs during conversion
-
main
Command-line entry point for the PDF/A-3 converter.Accepts
--level/-l,--output/-oand one or more--input/-iarguments (each optionally followed by--password/-pand a password value), as well as positional input paths. Each input may be a PDF file or a directory of PDF files; every resolved file is converted and written into the given output directory. Prints usage information and exits if the arguments are missing or invalid.- Parameters:
args- the command-line arguments
-