PdfGState state = new PdfGState(); state.setFillOpacity(100f); overContent.setGState(state);
/** * Sets the flag whether to apply overprint for stroking. * @param op */ public void setOverPrintStroking(boolean op) { put(PdfName.OP, op ? PdfBoolean.PDFTRUE : PdfBoolean.PDFFALSE); }
if (alpha < 1f) { cb.saveState(); PdfGState gState = new PdfGState(); gState.setFillOpacity(alpha); gState.setStrokeOpacity(alpha); cb.setGState(gState);
if (color.getAlpha() < 255) { cb.saveState(); final PdfGState gState = new PdfGState(); gState.setStrokeOpacity( getAlpha(properties)); cb.setGState(gState);
PdfGState gs = new PdfGState(); gs.setBlendMode(PdfGState.BM_DIFFERENCE); cb.setGState(gs); cb.setColorFill(new GrayColor(1.0f));
PdfGState graphicsState = new PdfGState(); graphicsState.FillOpacity = 0.5F; pdfData.SetGState(graphicsState);
cb.saveState(); float alpha = boxColor.getAlpha() / 255f; PdfGState gState = new PdfGState(); gState.setFillOpacity(alpha); cb.setGState(gState); cb.saveState(); float alpha = outlineColor.getAlpha() / 255f; PdfGState gState = new PdfGState(); gState.setStrokeOpacity(alpha); cb.setGState(gState);
cb.saveState(); float alpha = outlineColor.getAlpha() / 255f; PdfGState gState = new PdfGState(); gState.setStrokeOpacity(alpha); cb.setGState(gState);
PdfContentByte content= stamper.getUnderContent(1); LocationTextExtractionStrategy lteStrategy = new LocationTextExtractionStrategy(); String texte= PdfTextExtractor.getTextFromPage(read, 1, lteStrategy); pdflayer= new PdfLayer("Overrite", stamper.getWriter()); content.setColorFill(BaseColor.BLACK); content.beginLayer(pdflayer); content.fill(); PdfGState pgState = new PdfGState(); content.setGState(pgState); content.setColorFill(BaseColor.WHITE); content.setCharacterSpacing((float)6); content.beginText(); content.setTextMatrix(15, 385); content.showText("hello"); content.endText(); content.endLayer(); stamper.close(); read.close();
PdfReader pdfr=new PdfReader(File1);//existing file code here PdfStamper pdfs=new PdfStamper(pdfr, File2);//file to be modified ... PdfContentByte cb=pdfs.getOverContent(1); cb.setColorFill(new BaseColor(0x00,0x4E,0x44)); cb.rectangle(coordX,min_Y,60,haut); Phrase phrase = new Phrase(text, new Font(bf, fontSize));//insert text in rectangle ColumnText.showTextAligned(cb, Element.ALIGN_CENTER, phrase, // center horizontally (float) (coordX + coordX+60) / haut_c, //haut_c rect1, 0); cb.saveState(); PdfGState state=new PdfGState(); state.setFillOpacity(0.1f);//text is now visible cb.setGState(state); cb.fillStroke(); cb.restoreState();
PdfGState gs = fillGState[alpha]; if (gs == null) { gs = new PdfGState(); gs.setFillOpacity(alpha / 255f); fillGState[alpha] = gs; PdfGState gs = strokeGState[alpha]; if (gs == null) { gs = new PdfGState(); gs.setStrokeOpacity(alpha / 255f); strokeGState[alpha] = gs;
if (color.getAlpha() < 255) { cb.saveState(); final PdfGState gState = new PdfGState(); gState.setStrokeOpacity( getAlpha(properties)); cb.setGState(gState);
/** * The current blend mode to be used in the transparent imaging model. * @param bm */ public void setBlendMode(PdfName bm) { put(PdfName.BM, bm); }
public static void drawRectangle(PdfContentByte content, float width, float height) { content.saveState(); PdfGState state = new PdfGState(); state.setFillOpacity(0.6f); content.setGState(state); content.setRGBColorFill(0xFF, 0xFF, 0xFF); content.setLineWidth(3); content.rectangle(0, 0, width, height); content.fillStroke(); content.restoreState(); }
if (color.getAlpha() < 255) { cb.saveState(); final PdfGState gState = new PdfGState(); gState.setStrokeOpacity( getAlpha(properties)); cb.setGState(gState);
/** * Set the rendering intent, possible values are: PdfName.ABSOLUTECOLORIMETRIC, * PdfName.RELATIVECOLORIMETRIC, PdfName.SATURATION, PdfName.PERCEPTUAL. * @param ri * @since 5.0.2 */ public void setRenderingIntent(PdfName ri) { put(PdfName.RI, ri); }
painter.endText(); PdfGState state = new PdfGState(); state.setFillOpacity(0.5f);
PdfGState gs = strokeGState[alpha]; if (gs == null) { gs = new PdfGState(); gs.setStrokeOpacity(alpha / 255f); strokeGState[alpha] = gs;
/** * Sets the flag whether to apply overprint for non stroking painting operations. * @param op */ public void setOverPrintNonStroking(boolean op) { put(PdfName.op, op ? PdfBoolean.PDFTRUE : PdfBoolean.PDFFALSE); }
PdfGState gs = fillGState[255]; if (gs == null) { gs = new PdfGState(); gs.setFillOpacity(1); fillGState[255] = gs;