Classes
These classes are part of the Java application programming interface (API) for RICOH PDF2PDFUA.
enum EncryptionAlgorithm
Package: com.ricoh.pdf2pdfua.api
Option that specifies the encryption algorithm of the output PDF.
- none
- The output is not encrypted.
- preserve
- Preserves the encryption from the input PDF.
- Standard128
- An RC4 128 bit key-size stream cipher.
- AES128
- Advanced encryption standard that uses a 128-bit key length.
- AES256
- Advanced encryption standard that uses a 256-bit key length.
interface IControlFile
Package: com.ricoh.pdf2pdfua.api.
Represents the syntax tree of the control file. The control file is parsed once and applied on multiple PDF files.
IControlFile refresh() throws PreprocessingException;
Used to scan the control file for changes.
Returns this if the control file is up to date.
Returns a new IControlFile if the underlying files are no longer in-sync.
interface Pdfua
Package: com.ricoh.pdf2pdfua.api
The Java service provider interface (SPI) for RICOH PDF2PDFUA.
IControlFile newControlFile(String path);
Parses the control file specified by path. A single control file instance can be reused across multiple threads.
PdfUaOpt newOpt();
Creates an instance of PdfUaOpt with default configurations.
void run(FileInputStream fis, File out, IControlFile cf, PdfUaOpt opt) throws PDFUAException;
This method runs the PDF2PDFUA conversion. It is thread-safe and reentrant.
byte[] run(InputStream inPdf, IControlFile cf, PdfUaOpt opt) throws PDFUAException;
This method runs the PDF2PDFUA conversion and returns a byte array containing the tagged PDF. It is thread-safe and reentrant.
class PDFUAException extends Exception
Package: com.ricoh.pdf2pdfua.api
Base class for PDF2PDFUA conversion errors.
class PdfUaLoader
Package: com.ricoh.pdf2pdfua.api
Trivial helper that loads the PDF2PDFUA service implementation. The service can be loaded directly with a ServiceLoader.
public static Pdfua load();
Loads the PDF2PDFUA service implementation.
abstract class PdfUaOpt
Package: com.ricoh.pdf2pdfua.api
Used to configure the behavior of PDF2PDFUA. It is a configuration container that has only getters and setters.
This is an abstract class, but it must never be extended by API users. To get an instance,
use Pdfua.newOpt().
A single instance can be used by multiple threads but should not be modified while PDF2PDFUA is running.
public boolean getAllowAnnotations(); public void setAllowAnnotations(boolean allowAnnotation);
Permission flag for PDF encryption. Has no effect if the output is not encrypted by PDF2PDFUA.
Default value: false
public boolean getAllowAssemble(); public void setAllowAssemble(boolean allowAssemble);
Permission flag for PDF encryption. Has no effect if the output is not encrypted by PDF2PDFUA.
Default value: false
public boolean getAllowCopy(); public void setAllowCopy(boolean allowCopy);
Permission flag for PDF encryption. Has no effect if the output is not encrypted by PDF2PDFUA.
Default value: false
public boolean getAllowFill(); public void setAllowFill(boolean allowFill);
Permission flag for PDF encryption. Has no effect if the output is not encrypted by PDF2PDFUA.
Default value: false
public boolean getAllowModify(); public void setAllowModify(boolean allowModify);
Permission flag for PDF encryption. Has no effect if the output is not encrypted by PDF2PDFUA.
Default value: false
public boolean getAllowPrint(); public void setAllowPrint(boolean allowPrint);
Permission flag for PDF encryption. Has no effect if the output is not encrypted by PDF2PDFUA.
Default value: false
public boolean getAllowPrintDegraded(); public void setAllowPrintDegraded(boolean allowPrintDegraded);
Permission flag for PDF encryption. Has no effect if the output is not encrypted by PDF2PDFUA.
Default value: false
public byte[] getDecryptionKey(); public void setDecryptionKey(byte[] decryptionKey);
This option is required if the input PDF is encrypted. Used to unlock the input without removing the encryption. The owner key is preferable.
Default value: null
public EncryptionAlgorithm getEncryption(); public void setEncryption(EncryptionAlgorithm encryption);
Specifies the encryption algorithm of the output.
Default value: EncryptionAlgorithm.preserve
public Boolean getLinearize(); public void setLinearize(Boolean linearize);
If linearize is true: the output PDF is linearized.
If linearize is false: the output PDF is non-linearized.
If linearize is null: the output is linearized only if the input PDF was linearized.
Default value: null
public Logger getLog(); public void setLog(Logger log);
Default value: specified in the configuration file.
public boolean getOnlyMergeXObjects(); public void setOnlyMergeXObjects(boolean onlyMergeXObjects);
This option is used for development and testing. It must not be used in a production environment.
Default value: false
public byte[] getOwnerPassword(); public void setOwnerPassword(byte[] ownerPassword);
The owner password for PDF encryption. Has no effect if the output is not encrypted by PDF2PDFUA.
Default value: null
public PdfUaOutputHandler getStderrHandler(); public void setStderrHandler(PdfUaOutputHandler stderrHandler);
Used to handle the messages that are normally written to stderr. Default value: built-in handler as specified by the configuration file.
public PdfUaOutputHandler getStdoutHandler(); public void setStdoutHandler(PdfUaOutputHandler stdoutHandler);
Used to handle the messages that are normally written to stdout.
Default value: built-in handler as specified by the configuration file.
public PdfUaOutputHandler getTraceHandler(); public void setTraceHandler(PdfUaOutputHandler traceHandler);
Used only by the <Trace> command.
Default value: built-in handler as specified by the configuration file.
public boolean getUseLatestRevisions(); public void setUseLatestRevisions(boolean useLatestRevisions);
This option is used for development and testing. It must not be used in a production environment.
Default value: false
public byte[] getUserPassword(); public void setUserPassword(byte[] userPassword);
The user password for PDF encryption. Has no effect if the output is not encrypted by PDF2PDFUA.
Default value: null
interface PdfUaOutputHandler
Package: com.ricoh.pdf2pdfua.api
Handler for IO redirection.
void onMessage(Node src, int pageNo, String msg);
src: the XML node of the invoking control file rule. Null if the message cannot be traced
to an XML node.
pageNo: the page number starts from 1. This value is zero if the message cannot be traced
to a page.
msg: can contain multiple lines of text.
class PreprocessingException extends Exception
Package: com.ricoh.pdf2pdfua.api
Base class for errors that occur while the control file is preprocessed.
class UaStackTrace extends ArrayList<String>
Package: com.ricoh.pdf2pdfua.api
A stack trace that points to an XML element in the control file.
public static UaStackTrace unwind(final Node top);