/** * Set if the user can modify the document. * <p> * This method will have no effect if the object is in read only mode. * * @param allowModifications A boolean determining if the user can modify the document. */ public void setCanModify( boolean allowModifications ) { if(!readOnly) { setPermissionBit( MODIFICATION_BIT, allowModifications ); } }
/** * Set if the user can insert/rotate/delete pages. * <p> * This method will have no effect if the object is in read only mode. * * @param allowAssembly A boolean determining if the user can assemble the document. */ public void setCanAssembleDocument( boolean allowAssembly ) { if(!readOnly) { setPermissionBit( ASSEMBLE_DOCUMENT_BIT, allowAssembly ); } }
/** * Set if the user can print the document in a degraded format. * <p> * This method will have no effect if the object is in read only mode. * * @param canPrintDegraded A boolean determining if the user can print the * document in a degraded format. */ public void setCanPrintDegraded( boolean canPrintDegraded ) { if(!readOnly) { setPermissionBit( DEGRADED_PRINT_BIT, canPrintDegraded ); } }
/** * Set if the user can print. * <p> * This method will have no effect if the object is in read only mode. * * @param allowPrinting A boolean determining if the user can print. */ public void setCanPrint( boolean allowPrinting ) { if(!readOnly) { setPermissionBit( PRINT_BIT, allowPrinting ); } }
/** * Set if the user can extract content from the document for accessibility purposes. * <p> * This method will have no effect if the object is in read only mode. * * @param allowExtraction A boolean determining if the user can extract content * from the document. */ public void setCanExtractForAccessibility( boolean allowExtraction ) { if(!readOnly) { setPermissionBit( EXTRACT_FOR_ACCESSIBILITY_BIT, allowExtraction ); } }
/** * Set if the user can extract content from the document. * <p> * This method will have no effect if the object is in read only mode. * * @param allowExtraction A boolean determining if the user can extract content * from the document. */ public void setCanExtractContent( boolean allowExtraction ) { if(!readOnly) { setPermissionBit( EXTRACT_BIT, allowExtraction ); } }
/** * Set if the user can fill in interactive form fields (including signature fields) even if * {@link #canModifyAnnotations() canModifyAnnotations()} returns false. Therefore, if you want * to prevent a user from filling in interactive form fields, you need to call * {@link #setCanModifyAnnotations(boolean) setCanModifyAnnotations(false)} as well. *<p> * This method will have no effect if the object is in read only mode. * * @param allowFillingInForm A boolean determining if the user can fill in interactive forms. */ public void setCanFillInForm( boolean allowFillingInForm ) { if(!readOnly) { setPermissionBit( FILL_IN_FORM_BIT, allowFillingInForm ); } }
/** * Set if the user can add or modify text annotations and fill in interactive forms fields and, * if {@link #canModify() canModify()} returns true, create or modify interactive form fields * (including signature fields). Note that if {@link #canFillInForm() canFillInForm()} returns * true, it is still possible to fill in interactive forms (including signature fields) even the * parameter here is false. * <p> * This method will have no effect if the object is in read only mode. * * @param allowAnnotationModification A boolean determining the new setting. */ public void setCanModifyAnnotations( boolean allowAnnotationModification ) { if(!readOnly) { setPermissionBit( MODIFY_ANNOTATIONS_BIT, allowAnnotationModification ); } }
/** * This returns an integer representing the access permissions. * This integer can be used for public key encryption. This format * is not documented in the PDF specifications but is necessary for compatibility * with Adobe Acrobat and Adobe Reader. * * @return the integer representing access permissions */ public int getPermissionBytesForPublicKey() { setPermissionBit(1, true); setPermissionBit(7, false); setPermissionBit(8, false); for(int i=13; i<=32; i++) { setPermissionBit(i, false); } return bytes; }
/** * Set if the user can insert/rotate/delete pages. * <p> * This method will have no effect if the object is in read only mode. * * @param allowAssembly A boolean determining if the user can assemble the document. */ public void setCanAssembleDocument( boolean allowAssembly ) { if(!readOnly) { setPermissionBit( ASSEMBLE_DOCUMENT_BIT, allowAssembly ); } }
/** * Set if the user can print the document in a degraded format. * <p> * This method will have no effect if the object is in read only mode. * * @param canPrintDegraded A boolean determining if the user can print the * document in a degraded format. */ public void setCanPrintDegraded( boolean canPrintDegraded ) { if(!readOnly) { setPermissionBit( DEGRADED_PRINT_BIT, canPrintDegraded ); } }
/** * Set if the user can modify the document. * <p> * This method will have no effect if the object is in read only mode. * * @param allowModifications A boolean determining if the user can modify the document. */ public void setCanModify( boolean allowModifications ) { if(!readOnly) { setPermissionBit( MODIFICATION_BIT, allowModifications ); } }
/** * Set if the user can extract content from the document for accessibility purposes. * <p> * This method will have no effect if the object is in read only mode. * * @param allowExtraction A boolean determining if the user can extract content * from the document. */ public void setCanExtractForAccessibility( boolean allowExtraction ) { if(!readOnly) { setPermissionBit( EXTRACT_FOR_ACCESSIBILITY_BIT, allowExtraction ); } }
/** * Set if the user can extract content from the document. * <p> * This method will have no effect if the object is in read only mode. * * @param allowExtraction A boolean determining if the user can extract content * from the document. */ public void setCanExtractContent( boolean allowExtraction ) { if(!readOnly) { setPermissionBit( EXTRACT_BIT, allowExtraction ); } }
/** * Set if the user can print. * <p> * This method will have no effect if the object is in read only mode. * * @param allowPrinting A boolean determining if the user can print. */ public void setCanPrint( boolean allowPrinting ) { if(!readOnly) { setPermissionBit( PRINT_BIT, allowPrinting ); } }
/** * Set if the user can modify the document. * <p> * This method will have no effect if the object is in read only mode. * * @param allowModifications A boolean determining if the user can modify the document. */ public void setCanModify( boolean allowModifications ) { if(!readOnly) { setPermissionBit( MODIFICATION_BIT, allowModifications ); } }
/** * Set if the user can extract content from the document for accessibility purposes. * <p> * This method will have no effect if the object is in read only mode. * * @param allowExtraction A boolean determining if the user can extract content * from the document. */ public void setCanExtractForAccessibility( boolean allowExtraction ) { if(!readOnly) { setPermissionBit( EXTRACT_FOR_ACCESSIBILITY_BIT, allowExtraction ); } }
/** * Set if the user can print. * <p> * This method will have no effect if the object is in read only mode. * * @param allowPrinting A boolean determining if the user can print. */ public void setCanPrint( boolean allowPrinting ) { if(!readOnly) { setPermissionBit( PRINT_BIT, allowPrinting ); } }
/** * Set if the user can insert/rotate/delete pages. * <p> * This method will have no effect if the object is in read only mode. * * @param allowAssembly A boolean determining if the user can assemble the document. */ public void setCanAssembleDocument( boolean allowAssembly ) { if(!readOnly) { setPermissionBit( ASSEMBLE_DOCUMENT_BIT, allowAssembly ); } }
/** * Set if the user can extract content from the document. * <p> * This method will have no effect if the object is in read only mode. * * @param allowExtraction A boolean determining if the user can extract content * from the document. */ public void setCanExtractContent( boolean allowExtraction ) { if(!readOnly) { setPermissionBit( EXTRACT_BIT, allowExtraction ); } }