public class PDFUtils extends Object
Constructor and Description |
---|
PDFUtils() |
Modifier and Type | Method and Description |
---|---|
static File |
encrypt(File input,
String userPassword,
String ownerPassword,
int permissions)
Encrypt a document and set permissions
If a PDF is encrypted using an owner password but no user password, anyone can open the PDF and is restricted by the permissions
selected during encryption.
|
static void |
encrypt(InputStream input,
String userPassword,
String ownerPassword,
int permissions,
OutputStream output)
Encrypt a document and set permissions
If a PDF is encrypted using an owner password but no user password, anyone can open the PDF and is restricted by the permissions
selected during encryption.
|
static void |
encrypt(String token,
String docId,
String userPassword,
String ownerPassword,
int permissions,
String dstPath)
Encrypt a document and set permissions.
|
static void |
fillForm(InputStream input,
Map<String,Object> values,
OutputStream output)
Fill PDF form
|
static void |
generateSample(int paragraphs,
OutputStream os)
Generate sample PDF
|
static List<String> |
listFormFields(String input)
List form fields
|
static File |
markToPrint(File input)
Mark PDF to be printed.
|
static void |
merge(List<InputStream> inputs,
OutputStream output)
Merge several PDFs into a new one
|
static void |
merge(String token,
List<String> docIds,
String dstPath)
Merge several PDFs into a new one
|
public static void fillForm(InputStream input, Map<String,Object> values, OutputStream output) throws FileNotFoundException, com.lowagie.text.DocumentException, freemarker.template.TemplateException, IOException
FileNotFoundException
com.lowagie.text.DocumentException
freemarker.template.TemplateException
IOException
public static List<String> listFormFields(String input) throws FileNotFoundException, com.lowagie.text.DocumentException, IOException
FileNotFoundException
com.lowagie.text.DocumentException
IOException
public static void generateSample(int paragraphs, OutputStream os) throws com.lowagie.text.DocumentException
com.lowagie.text.DocumentException
public static void merge(List<InputStream> inputs, OutputStream output) throws IOException, com.lowagie.text.DocumentException
IOException
com.lowagie.text.DocumentException
public static void merge(String token, List<String> docIds, String dstPath) throws IOException, com.lowagie.text.DocumentException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, UnsupportedMimeTypeException, FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, ExtensionException, AutomationException, LockException, VersionException
token
- Authentication info.docIds
- The paths that identifies an unique documents or its UUID.dstPath
- The path of the resulting PDF document (with the name).IOException
com.lowagie.text.DocumentException
PathNotFoundException
AccessDeniedException
RepositoryException
DatabaseException
UnsupportedMimeTypeException
FileSizeExceededException
UserQuotaExceededException
VirusDetectedException
ExtensionException
AutomationException
LockException
VersionException
public static File markToPrint(File input) throws com.lowagie.text.DocumentException, IOException
com.lowagie.text.DocumentException
IOException
public static void encrypt(InputStream input, String userPassword, String ownerPassword, int permissions, OutputStream output) throws com.lowagie.text.DocumentException, IOException
com.lowagie.text.DocumentException
IOException
public static File encrypt(File input, String userPassword, String ownerPassword, int permissions) throws com.lowagie.text.DocumentException, IOException
com.lowagie.text.DocumentException
IOException
public static void encrypt(String token, String docId, String userPassword, String ownerPassword, int permissions, String dstPath) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, IOException, com.lowagie.text.DocumentException, FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, VersionException, ExtensionException, UnsupportedMimeTypeException, ItemExistsException, AutomationException
token
- Authentication info.docId
- The path that identifies an unique document or its UUID.userPassword
- The user password.ownerPassword
- The owner password.permissions
- ORed PDF permissions.dstPath
- The path of the resulting PDF document (with the name).LockException
PathNotFoundException
AccessDeniedException
RepositoryException
DatabaseException
IOException
com.lowagie.text.DocumentException
FileSizeExceededException
UserQuotaExceededException
VirusDetectedException
VersionException
ExtensionException
UnsupportedMimeTypeException
ItemExistsException
AutomationException
Copyright © 2017 Open Knowledge Management System S.L.. All rights reserved.