Class PdfA3Converter
-
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(byte[] input, byte[] password, OutputStream output) Convert the given PDF file into a PDF/A-3 file, writing the result tooutput.convert(byte[] input, OutputStream output) Convert 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.Convert the given PDF file into a PDF/A-3 file, writing the result tooutput.convert(InputStream input, byte[] password, OutputStream output) Convert the given PDF file into a PDF/A-3 file, writing the result tooutput.convert(InputStream input, OutputStream output) 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.booleanCheck if output will be linearized for fast web viewstatic voidCommand-line entry point for the PDF/A-3 converter.voidsetLinearizeDocument(boolean linearizeDocument) Set f the output of writeDocument should be linearized for fast web view.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:
-
isLinearizeDocument
public boolean isLinearizeDocument()Check if output will be linearized for fast web view- Returns:
- True is the file will be linearized, otherwise False
-
setLinearizeDocument
public void setLinearizeDocument(boolean linearizeDocument) Set f the output of writeDocument should be linearized for fast web view.- Parameters:
linearizeDocument- True is output should be linearized, otherwise False
-
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.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 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 is invalid or an I/O error occurs during conversion
-
convert
public PdfA3Converter.ConversionResult convert(byte[] input, OutputStream output) throws IOException 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.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 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(byte[] input, byte[] password, OutputStream 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 is invalid or an I/O error occurs during conversion
-
convert
public PdfA3Converter.ConversionResult convert(InputStream input, OutputStream output) throws IOException 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.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 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:
- API Note:
- PDF files must allow for random access, so the InputStream is read fully then cached to disk. The file is encrypted at rest and deleted once close is called.
-
convert
public PdfA3Converter.ConversionResult convert(InputStream input, byte[] password, OutputStream 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 is invalid or an I/O error occurs during conversion- API Note:
- PDF files must allow for random access, so the InputStream is read fully then cached to disk. The file is encrypted at rest and deleted once close is called.
-
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
-