public PdfBoolean isVolatile() { return ((PdfDictionary) getPdfObject()).getAsBoolean(PdfName.Volatile); }
/** * Returns the value associated to this key as a Boolean. If the value isn't a PdfBoolean, null is returned. * * @param key the key of which the associated value needs to be returned * @return Boolean associated with this key */ public Boolean getAsBool(PdfName key) { PdfBoolean b = getAsBoolean(key); Boolean booleanValue = null; if (b != null) { booleanValue = b.getValue(); } return booleanValue; }
public PdfBoolean isInteractive() { return getPdfObject().getAsBoolean(PdfName._3DI); }
public PdfBoolean getRepeat() { return getPdfObject().getAsBoolean(PdfName.Repeat); }
public PdfBoolean getVisibility() { return getPdfObject().getAsBoolean(PdfName.V); }
public PdfBoolean getEditable() { return getPdfObject().getAsBoolean(PdfName.E); }
/** * Gets the <code>NeedAppearances</code> boolean property on the AcroForm. * NeedAppearances has been deprecated in PDF 2.0. * <br> * <blockquote> * NeedAppearances is a flag specifying whether to construct appearance * streams and appearance dictionaries for all widget annotations in the * document. * (ISO 32000-1, section 12.7.2 "Interactive Form Dictionary") * </blockquote> * * @return the <code>NeedAppearances</code> property as a {@link PdfBoolean}. Default value is <code>false</code> */ public PdfBoolean getNeedAppearances() { return getPdfObject().getAsBoolean(PdfName.NeedAppearances); }
/** * Gets the <code>NeedAppearances</code> boolean property on the AcroForm. * NeedAppearances has been deprecated in PDF 2.0. * <br> * <blockquote> * NeedAppearances is a flag specifying whether to construct appearance * streams and appearance dictionaries for all widget annotations in the * document. * (ISO 32000-1, section 12.7.2 "Interactive Form Dictionary") * </blockquote> * * @return the <code>NeedAppearances</code> property as a {@link PdfBoolean}. Default value is <code>false</code> */ public PdfBoolean getNeedAppearances() { return getPdfObject().getAsBoolean(PdfName.NeedAppearances); }
/** * If true, the text specified by the {@link PdfName#Contents} or {@link PdfName#RC} entries * (see {@link PdfAnnotation#getContents()} and {@link PdfMarkupAnnotation#getRichText()}) * is replicated as a caption in the appearance of the line. * @return true, if the annotation text is replicated as a caption, false otherwise. If this property is * not set, default value is used which is <i>false</i>. */ public boolean getContentsAsCaption() { PdfBoolean b = getPdfObject().getAsBoolean(PdfName.Cap); return b != null && b.getValue(); }
/** * A flag specifying whether the annotation shall initially be displayed open. * This flag has affect to not all kinds of annotations. * @return true if annotation is initially open, false - if closed. */ public boolean getOpen() { return PdfBoolean.TRUE.equals(getPdfObject().getAsBoolean(PdfName.Open)); }
/** * A flag specifying whether the annotation shall initially be displayed open. * This flag has affect to not all kinds of annotations. * @return true if annotation is initially open, false - if closed. */ public boolean getOpen() { return PdfBoolean.TRUE.equals(getPdfObject().getAsBoolean(PdfName.Open)); }
@Override protected void checkLogicalStructure(PdfDictionary catalog) { if (checkStructure(conformanceLevel)) { PdfDictionary markInfo = catalog.getAsDictionary(PdfName.MarkInfo); if (markInfo == null || markInfo.getAsBoolean(PdfName.Marked) == null || !markInfo.getAsBoolean(PdfName.Marked).getValue()) { throw new PdfAConformanceException(PdfAConformanceException.A_CATALOG_SHALL_INCLUDE_MARK_INFO_DICTIONARY_WITH_MARKED_TRUE_VALUE); } if (!catalog.containsKey(PdfName.Lang)) { Logger logger = LoggerFactory.getLogger(PdfAChecker.class); logger.warn(PdfAConformanceLogMessageConstant.CATALOG_SHOULD_CONTAIN_LANG_ENTRY); } } }
@Override protected void checkLogicalStructure(PdfDictionary catalog) { if (checkStructure(conformanceLevel)) { PdfDictionary markInfo = catalog.getAsDictionary(PdfName.MarkInfo); if (markInfo == null || markInfo.getAsBoolean(PdfName.Marked) == null || !markInfo.getAsBoolean(PdfName.Marked).getValue()) { throw new PdfAConformanceException(PdfAConformanceException.A_CATALOG_SHALL_INCLUDE_MARK_INFO_DICTIONARY_WITH_MARKED_TRUE_VALUE); } if (!catalog.containsKey(PdfName.Lang)) { Logger logger = LoggerFactory.getLogger(PdfAChecker.class); logger.warn(PdfAConformanceLogMessageConstant.CATALOG_SHOULD_CONTAIN_LANG_ENTRY); } } }
@Override protected void checkForm(PdfDictionary form) { if (form != null) { PdfBoolean needAppearances = form.getAsBoolean(PdfName.NeedAppearances); if (needAppearances != null && needAppearances.getValue()) { throw new PdfAConformanceException(PdfAConformanceException.NEEDAPPEARANCES_FLAG_OF_THE_INTERACTIVE_FORM_DICTIONARY_SHALL_EITHER_NOT_BE_PRESENTED_OR_SHALL_BE_FALSE); } if (form.containsKey(PdfName.XFA)) { throw new PdfAConformanceException(PdfAConformanceException.THE_INTERACTIVE_FORM_DICTIONARY_SHALL_NOT_CONTAIN_THE_XFA_KEY); } checkResources(form.getAsDictionary(PdfName.DR)); PdfArray fields = form.getAsArray(PdfName.Fields); if (fields != null) { fields = getFormFields(fields); for (PdfObject field : fields) { PdfDictionary fieldDic = (PdfDictionary) field; checkResources(fieldDic.getAsDictionary(PdfName.DR)); } } } }
@Override protected void checkForm(PdfDictionary form) { if (form != null) { PdfBoolean needAppearances = form.getAsBoolean(PdfName.NeedAppearances); if (needAppearances != null && needAppearances.getValue()) { throw new PdfAConformanceException(PdfAConformanceException.NEEDAPPEARANCES_FLAG_OF_THE_INTERACTIVE_FORM_DICTIONARY_SHALL_EITHER_NOT_BE_PRESENTED_OR_SHALL_BE_FALSE); } if (form.containsKey(PdfName.XFA)) { throw new PdfAConformanceException(PdfAConformanceException.THE_INTERACTIVE_FORM_DICTIONARY_SHALL_NOT_CONTAIN_THE_XFA_KEY); } checkResources(form.getAsDictionary(PdfName.DR)); PdfArray fields = form.getAsArray(PdfName.Fields); if (fields != null) { fields = getFormFields(fields); for (PdfObject field : fields) { PdfDictionary fieldDic = (PdfDictionary) field; checkResources(fieldDic.getAsDictionary(PdfName.DR)); } } } }
@Override protected void checkForm(PdfDictionary form) { if (form == null) return; PdfBoolean needAppearances = form.getAsBoolean(PdfName.NeedAppearances); if (needAppearances != null && needAppearances.getValue()) { throw new PdfAConformanceException(PdfAConformanceException.NEEDAPPEARANCES_FLAG_OF_THE_INTERACTIVE_FORM_DICTIONARY_SHALL_EITHER_NOT_BE_PRESENTED_OR_SHALL_BE_FALSE); } checkResources(form.getAsDictionary(PdfName.DR)); PdfArray fields = form.getAsArray(PdfName.Fields); if (fields != null) { fields = getFormFields(fields); for (PdfObject field : fields) { PdfDictionary fieldDic = (PdfDictionary) field; if (fieldDic.containsKey(PdfName.A) || fieldDic.containsKey(PdfName.AA)) { throw new PdfAConformanceException(PdfAConformanceException.WIDGET_ANNOTATION_DICTIONARY_OR_FIELD_DICTIONARY_SHALL_NOT_INCLUDE_A_OR_AA_ENTRY); } checkResources(fieldDic.getAsDictionary(PdfName.DR)); } } }
if (kn != null) k = kn.intValue(); PdfBoolean bo = param.getAsBoolean(PdfName.BlackIs1); if (bo != null) blackIs1 = bo.getValue(); bo = param.getAsBoolean(PdfName.EncodedByteAlign); if (bo != null) byteAlign = bo.getValue();
@Override protected void checkForm(PdfDictionary form) { if (form == null) return; PdfBoolean needAppearances = form.getAsBoolean(PdfName.NeedAppearances); if (needAppearances != null && needAppearances.getValue()) { throw new PdfAConformanceException(PdfAConformanceException.NEEDAPPEARANCES_FLAG_OF_THE_INTERACTIVE_FORM_DICTIONARY_SHALL_EITHER_NOT_BE_PRESENTED_OR_SHALL_BE_FALSE); } checkResources(form.getAsDictionary(PdfName.DR)); PdfArray fields = form.getAsArray(PdfName.Fields); if (fields != null) { fields = getFormFields(fields); for (PdfObject field : fields) { PdfDictionary fieldDic = (PdfDictionary) field; if (fieldDic.containsKey(PdfName.A) || fieldDic.containsKey(PdfName.AA)) { throw new PdfAConformanceException(PdfAConformanceException.WIDGET_ANNOTATION_DICTIONARY_OR_FIELD_DICTIONARY_SHALL_NOT_INCLUDE_A_OR_AA_ENTRY); } checkResources(fieldDic.getAsDictionary(PdfName.DR)); } } }
throw new PdfException(PdfException.NoCompatibleEncryptionFound); PdfBoolean em = encDict.getAsBoolean(PdfName.EncryptMetadata); if (em != null && !em.getValue()) { cryptoMode |= EncryptionConstants.DO_NOT_ENCRYPT_METADATA; case 6: cryptoMode = EncryptionConstants.ENCRYPTION_AES_256; PdfBoolean em5 = encDict.getAsBoolean(PdfName.EncryptMetadata); if (em5 != null && !em5.getValue()) { cryptoMode |= EncryptionConstants.DO_NOT_ENCRYPT_METADATA;
throw new PdfException(PdfException.NoCompatibleEncryptionFound); PdfBoolean em = dic.getAsBoolean(PdfName.EncryptMetadata); if (em != null && !em.getValue()) { cryptoMode |= EncryptionConstants.DO_NOT_ENCRYPT_METADATA;