@Override protected PdfObject newInstance() { return new PdfBoolean(); }
/** * Simple method that compares two given PdfBooleans. * * @param outBoolean boolean to compare. * @param cmpBoolean boolean to compare. * @return true if booleans are equal, otherwise false. */ public boolean compareBooleans(PdfBoolean outBoolean, PdfBoolean cmpBoolean) { return cmpBoolean.getValue() == outBoolean.getValue(); }
/** * Create a new PdfArray filled with the values in the boolean[] as {@link com.itextpdf.kernel.pdf.PdfBoolean}. * * @param values values to be added to this PdfArray */ public PdfArray(boolean[] values) { list = new ArrayList<>(values.length); for (boolean b : values) { list.add(PdfBoolean.valueOf(b)); } }
/** * 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)); }
/** * This method sets DisplayDocTitle flag to true or false * @param displayDocTitle */ public PdfViewerPreferences setDisplayDocTitle(boolean displayDocTitle) { return put(PdfName.DisplayDocTitle, PdfBoolean.valueOf(displayDocTitle)); }
private boolean compareBooleansExtended(PdfBoolean outBoolean, PdfBoolean cmpBoolean, ObjectPath currentPath, CompareResult compareResult) { if (cmpBoolean.getValue() == outBoolean.getValue()) { return true; } else { if (compareResult != null && currentPath != null) compareResult.addError(currentPath, MessageFormatUtil.format("PdfBoolean. Expected: {0}. Found: {1}.", cmpBoolean.getValue(), outBoolean.getValue())); return false; } }
/** * Creates a Launch action (section 12.6.4.5 of ISO 32000-1). * * @param fileSpec the application that shall be launched or the document that shall beopened or printed * @param newWindow a flag specifying whether to open the destination document in a new window * @return created action */ public static PdfAction createLaunch(PdfFileSpec fileSpec, boolean newWindow) { return createLaunch(fileSpec).put(PdfName.NewWindow, new PdfBoolean(newWindow)); }
/** * Sets the alpha source flag ("alpha is shape"), specifying whether the current soft mask and alpha constant * shall be interpreted as shape values ({@code true}) or opacity values ({@code false}), {@code AIS} key. * * @param alphaSourceFlag if {@code true} - alpha as shape values, if {@code false} — as opacity values. * @return object itself. */ public PdfExtGState setAlphaSourceFlag(boolean alphaSourceFlag) { return put(PdfName.AIS, PdfBoolean.valueOf(alphaSourceFlag)); }
/** * 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 PdfUserProperty setHidden(boolean isHidden) { getPdfObject().put(PdfName.H, new PdfBoolean(isHidden)); return this; }
/** * Sets a flag specifying whether the annotation shall initially be displayed open. * This flag has affect to not all kinds of annotations. * @param open true if annotation shall initially be open, false - if closed. * @return this {@link PdfTextAnnotation} instance. */ public PdfTextAnnotation setOpen(boolean open) { return (PdfTextAnnotation) put(PdfName.Open, PdfBoolean.valueOf(open)); }
/** * 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(); }
public PdfUserProperty setValue(boolean value) { getPdfObject().put(PdfName.V, new PdfBoolean(value)); return this; }
/** * This method sets HideToolBar flag to true or false * @param hideToolbar */ public PdfViewerPreferences setHideToolbar(boolean hideToolbar) { return put(PdfName.HideToolbar, PdfBoolean.valueOf(hideToolbar)); }
@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); } } }
return PdfBoolean.TRUE; } else if (getTokeniser().tokenValueEqualsTo(PdfTokenizer.False)) { return new PdfBoolean(false);
/** * This method sets PickTrayByPDFSize flag to true or false. * @param pickTrayByPdfSize */ public PdfViewerPreferences setPickTrayByPDFSize(boolean pickTrayByPdfSize) { return put(PdfName.PickTrayByPDFSize, PdfBoolean.valueOf(pickTrayByPdfSize)); }
@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); } } }
return PdfBoolean.TRUE; } else { return new PdfBoolean(true); return PdfBoolean.FALSE; } else { return new PdfBoolean(false);