/** * 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)); } }
/** * This method sets DisplayDocTitle flag to true or false * @param displayDocTitle */ public PdfViewerPreferences setDisplayDocTitle(boolean displayDocTitle) { return put(PdfName.DisplayDocTitle, PdfBoolean.valueOf(displayDocTitle)); }
/** * 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)); }
/** * 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 PdfPopupAnnotation} instance. */ public PdfPopupAnnotation setOpen(boolean open) { return (PdfPopupAnnotation) put(PdfName.Open, PdfBoolean.valueOf(open)); }
/** * 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)); }
/** * This method sets HideToolBar flag to true or false * @param hideToolbar */ public PdfViewerPreferences setHideToolbar(boolean hideToolbar) { return put(PdfName.HideToolbar, PdfBoolean.valueOf(hideToolbar)); }
/** * This method sets PickTrayByPDFSize flag to true or false. * @param pickTrayByPdfSize */ public PdfViewerPreferences setPickTrayByPDFSize(boolean pickTrayByPdfSize) { return put(PdfName.PickTrayByPDFSize, PdfBoolean.valueOf(pickTrayByPdfSize)); }
/** * If set to true, the text specified by the {@link PdfName#Contents} or {@link PdfName#RC} entries * (see {@link PdfAnnotation#getContents()} and {@link PdfMarkupAnnotation#getRichText()}) * will be replicated as a caption in the appearance of the line. * @param contentsAsCaption true, if the annotation text should be replicated as a caption, false otherwise. * @return this {@link PdfLineAnnotation} instance. */ public PdfLineAnnotation setContentsAsCaption(boolean contentsAsCaption) { return (PdfLineAnnotation) put(PdfName.Cap, PdfBoolean.valueOf(contentsAsCaption)); }
/** * This method sets FitWindow flag to true or false * @param fitWindow */ public PdfViewerPreferences setFitWindow(boolean fitWindow) { return put(PdfName.FitWindow, PdfBoolean.valueOf(fitWindow)); }
/** * This method sets CenterWindow flag to true or false * @param centerWindow */ public PdfViewerPreferences setCenterWindow(boolean centerWindow) { return put(PdfName.CenterWindow, PdfBoolean.valueOf(centerWindow)); }
/** * Set overprint flag value for <b>stroking</b> operations, {@code OP} key. * * @param strokeOverPrintFlag {@code true}, for applying overprint for <b>stroking</b> operations. * @return object itself. */ public PdfExtGState setStrokeOverPrintFlag(boolean strokeOverPrintFlag) { return put(PdfName.OP, PdfBoolean.valueOf(strokeOverPrintFlag)); }
/** * Set overprint flag value for <b>non-stroking</b> operations, {@code op} key. * * @param fillOverprintFlag {@code true}, for applying overprint for <b>non-stroking</b> operations. * @return object itself. */ public PdfExtGState setFillOverPrintFlag(boolean fillOverprintFlag) { return put(PdfName.op, PdfBoolean.valueOf(fillOverprintFlag)); }
/** * Sets value of an automatic stroke adjustment flag, {@code SA} key. * * @param strokeAdjustment a {@code boolean} value. * @return object itself. */ public PdfExtGState setAutomaticStrokeAdjustmentFlag(boolean strokeAdjustment) { return put(PdfName.SA, PdfBoolean.valueOf(strokeAdjustment)); }
/** * This method sets HideWindowUI flag to true or false * @param hideWindowUI */ public PdfViewerPreferences setHideWindowUI(boolean hideWindowUI) { return put(PdfName.HideWindowUI, PdfBoolean.valueOf(hideWindowUI)); }
/** * Creates a GoToR action, or remote action (section 12.6.4.3 of ISO 32000-1). * * @param fileSpec the file in which the destination shall be located * @param destination the destination in the remote document to jump to * @param newWindow a flag specifying whether to open the destination document in a new window * @return created action */ public static PdfAction createGoToR(PdfFileSpec fileSpec, PdfDestination destination, boolean newWindow) { return createGoToR(fileSpec, destination).put(PdfName.NewWindow, PdfBoolean.valueOf(newWindow)); }
/** * Indication if the field value should be editable in the viewer. * * @param editable */ public PdfCollectionField setEditable(boolean editable) { getPdfObject().put(PdfName.E, PdfBoolean.valueOf(editable)); return this; }
/** * Creates a Hide action (section 12.6.4.10 of ISO 32000-1). * * @param text a text string giving the fully qualified field name of an interactive form field whose * associated widget annotation or annotations are to be affected * @param hidden a flag indicating whether to hide the annotation (<code>true</code>) or show it (<code>false</code>) * @return created action */ public static PdfAction createHide(String text, boolean hidden) { return new PdfAction().put(PdfName.S, PdfName.Hide).put(PdfName.T, new PdfString(text)). put(PdfName.H, PdfBoolean.valueOf(hidden)); }
/** * Creates a URI action (section 12.6.4.7 of ISO 32000-1). * * @param uri the uniform resource identifier to resolve * @param isMap a flag specifying whether to track the mouse position when the URI is resolved * @return created action */ public static PdfAction createURI(String uri, boolean isMap) { return new PdfAction().put(PdfName.S, PdfName.URI).put(PdfName.URI, new PdfString(uri)).put(PdfName.IsMap, PdfBoolean.valueOf(isMap)); }
/** * Creates a Hide action (section 12.6.4.10 of ISO 32000-1). * * @param annotation the annotation to be hidden or shown * @param hidden a flag indicating whether to hide the annotation (<code>true</code>) or show it (<code>false</code>) * @return created action */ public static PdfAction createHide(PdfAnnotation annotation, boolean hidden) { return new PdfAction().put(PdfName.S, PdfName.Hide).put(PdfName.T, annotation.getPdfObject()). put(PdfName.H, PdfBoolean.valueOf(hidden)); }
/** * Creates a Hide action (section 12.6.4.10 of ISO 32000-1). * * @param annotations the annotations to be hidden or shown * @param hidden a flag indicating whether to hide the annotation (<code>true</code>) or show it (<code>false</code>) * @return created action */ public static PdfAction createHide(PdfAnnotation[] annotations, boolean hidden) { return new PdfAction().put(PdfName.S, PdfName.Hide).put(PdfName.T, getPdfArrayFromAnnotationsList(annotations)). put(PdfName.H, PdfBoolean.valueOf(hidden)); }