congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
PageResources.addColor
Code IndexAdd Tabnine to your IDE (free)

How to use
addColor
method
in
com.lowagie.text.pdf.PageResources

Best Java code snippets using com.lowagie.text.pdf.PageResources.addColor (Showing top 20 results out of 315)

origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/** Sets the fill color to a spot color.
 * @param sp the spot color
 * @param tint the tint for the spot color. 0 is no color and 1
 * is 100% color
 */
public void setColorFill(PdfSpotColor sp, float tint) {
  checkWriter();
  state.colorDetails = writer.addSimple(sp);
  PageResources prs = getPageResources();
  PdfName name = state.colorDetails.getColorName();
  name = prs.addColor(name, state.colorDetails.getIndirectReference());
  content.append(name.getBytes()).append(" cs ").append(tint).append(" scn").append_i(separator);
}
origin: com.github.librepdf/openpdf

/** Sets the fill color to a spot color.
 * @param sp the spot color
 * @param tint the tint for the spot color. 0 is no color and 1
 * is 100% color
 */
public void setColorFill(PdfSpotColor sp, float tint) {
  checkWriter();
  state.colorDetails = writer.addSimple(sp);
  PageResources prs = getPageResources();
  PdfName name = state.colorDetails.getColorName();
  name = prs.addColor(name, state.colorDetails.getIndirectReference());
  content.append(name.getBytes()).append(" cs ").append(tint).append(" scn").append_i(separator);
}
origin: com.github.librepdf/openpdf

/** Sets the stroke color to a spot color.
 * @param sp the spot color
 * @param tint the tint for the spot color. 0 is no color and 1
 * is 100% color
 */
public void setColorStroke(PdfSpotColor sp, float tint) {
  checkWriter();
  state.colorDetails = writer.addSimple(sp);
  PageResources prs = getPageResources();
  PdfName name = state.colorDetails.getColorName();
  name = prs.addColor(name, state.colorDetails.getIndirectReference());
  content.append(name.getBytes()).append(" CS ").append(tint).append(" SCN").append_i(separator);
}
origin: es.gob.afirma/afirma-crypto-pdf-itext

/** Sets the stroke color to a spot color.
 * @param sp the spot color
 * @param tint the tint for the spot color. 0 is no color and 1
 * is 100% color
 */
public void setColorStroke(PdfSpotColor sp, float tint) {
  checkWriter();
  state.colorDetails = writer.addSimple(sp);
  PageResources prs = getPageResources();
  PdfName name = state.colorDetails.getColorName();
  name = prs.addColor(name, state.colorDetails.getIndirectReference());
  content.append(name.getBytes()).append(" CS ").append(tint).append(" SCN").append_i(separator);
}
origin: es.gob.afirma/afirma-crypto-pdf-itext

/** Sets the fill color to a spot color.
 * @param sp the spot color
 * @param tint the tint for the spot color. 0 is no color and 1
 * is 100% color
 */
public void setColorFill(PdfSpotColor sp, float tint) {
  checkWriter();
  state.colorDetails = writer.addSimple(sp);
  PageResources prs = getPageResources();
  PdfName name = state.colorDetails.getColorName();
  name = prs.addColor(name, state.colorDetails.getIndirectReference());
  content.append(name.getBytes()).append(" cs ").append(tint).append(" scn").append_i(separator);
}
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/** Sets the stroke color to a spot color.
 * @param sp the spot color
 * @param tint the tint for the spot color. 0 is no color and 1
 * is 100% color
 */
public void setColorStroke(PdfSpotColor sp, float tint) {
  checkWriter();
  state.colorDetails = writer.addSimple(sp);
  PageResources prs = getPageResources();
  PdfName name = state.colorDetails.getColorName();
  name = prs.addColor(name, state.colorDetails.getIndirectReference());
  content.append(name.getBytes()).append(" CS ").append(tint).append(" SCN").append_i(separator);
}
origin: es.gob.afirma/afirma-crypto-pdf-itext

/**
 * Paints using a shading object.
 * @param shading the shading object
 */
public void paintShading(PdfShading shading) {
  writer.addSimpleShading(shading);
  PageResources prs = getPageResources();
  PdfName name = prs.addShading(shading.getShadingName(), shading.getShadingReference());
  content.append(name.getBytes()).append(" sh").append_i(separator);
  ColorDetails details = shading.getColorDetails();
  if (details != null)
    prs.addColor(details.getColorName(), details.getIndirectReference());
}
origin: com.github.librepdf/openpdf

/**
 * Paints using a shading object.
 * @param shading the shading object
 */
public void paintShading(PdfShading shading) {
  writer.addSimpleShading(shading);
  PageResources prs = getPageResources();
  PdfName name = prs.addShading(shading.getShadingName(), shading.getShadingReference());
  content.append(name.getBytes()).append(" sh").append_i(separator);
  ColorDetails details = shading.getColorDetails();
  if (details != null)
    prs.addColor(details.getColorName(), details.getIndirectReference());
}
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/**
 * Paints using a shading object.
 * @param shading the shading object
 */
public void paintShading(PdfShading shading) {
  writer.addSimpleShading(shading);
  PageResources prs = getPageResources();
  PdfName name = prs.addShading(shading.getShadingName(), shading.getShadingReference());
  content.append(name.getBytes()).append(" sh").append_i(separator);
  ColorDetails details = shading.getColorDetails();
  if (details != null)
    prs.addColor(details.getColorName(), details.getIndirectReference());
}
origin: com.github.librepdf/openpdf

/**
 * Sets the shading fill pattern.
 * @param shading the shading pattern
 */
public void setShadingFill(PdfShadingPattern shading) {
  writer.addSimpleShadingPattern(shading);
  PageResources prs = getPageResources();
  PdfName name = prs.addPattern(shading.getPatternName(), shading.getPatternReference());
  content.append(PdfName.PATTERN.getBytes()).append(" cs ").append(name.getBytes()).append(" scn").append_i(separator);
  ColorDetails details = shading.getColorDetails();
  if (details != null)
    prs.addColor(details.getColorName(), details.getIndirectReference());
}
origin: com.github.librepdf/openpdf

/**
 * Sets the shading stroke pattern
 * @param shading the shading pattern
 */
public void setShadingStroke(PdfShadingPattern shading) {
  writer.addSimpleShadingPattern(shading);
  PageResources prs = getPageResources();
  PdfName name = prs.addPattern(shading.getPatternName(), shading.getPatternReference());
  content.append(PdfName.PATTERN.getBytes()).append(" CS ").append(name.getBytes()).append(" SCN").append_i(separator);
  ColorDetails details = shading.getColorDetails();
  if (details != null)
    prs.addColor(details.getColorName(), details.getIndirectReference());
}
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/**
 * Sets the shading fill pattern.
 * @param shading the shading pattern
 */
public void setShadingFill(PdfShadingPattern shading) {
  writer.addSimpleShadingPattern(shading);
  PageResources prs = getPageResources();
  PdfName name = prs.addPattern(shading.getPatternName(), shading.getPatternReference());
  content.append(PdfName.PATTERN.getBytes()).append(" cs ").append(name.getBytes()).append(" scn").append_i(separator);
  ColorDetails details = shading.getColorDetails();
  if (details != null)
    prs.addColor(details.getColorName(), details.getIndirectReference());
}
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/**
 * Sets the shading stroke pattern
 * @param shading the shading pattern
 */
public void setShadingStroke(PdfShadingPattern shading) {
  writer.addSimpleShadingPattern(shading);
  PageResources prs = getPageResources();
  PdfName name = prs.addPattern(shading.getPatternName(), shading.getPatternReference());
  content.append(PdfName.PATTERN.getBytes()).append(" CS ").append(name.getBytes()).append(" SCN").append_i(separator);
  ColorDetails details = shading.getColorDetails();
  if (details != null)
    prs.addColor(details.getColorName(), details.getIndirectReference());
}
origin: es.gob.afirma/afirma-crypto-pdf-itext

/**
 * Sets the shading stroke pattern
 * @param shading the shading pattern
 */
public void setShadingStroke(PdfShadingPattern shading) {
  writer.addSimpleShadingPattern(shading);
  PageResources prs = getPageResources();
  PdfName name = prs.addPattern(shading.getPatternName(), shading.getPatternReference());
  content.append(PdfName.PATTERN.getBytes()).append(" CS ").append(name.getBytes()).append(" SCN").append_i(separator);
  ColorDetails details = shading.getColorDetails();
  if (details != null)
    prs.addColor(details.getColorName(), details.getIndirectReference());
}
origin: es.gob.afirma/afirma-crypto-pdf-itext

/**
 * Sets the shading fill pattern.
 * @param shading the shading pattern
 */
public void setShadingFill(PdfShadingPattern shading) {
  writer.addSimpleShadingPattern(shading);
  PageResources prs = getPageResources();
  PdfName name = prs.addPattern(shading.getPatternName(), shading.getPatternReference());
  content.append(PdfName.PATTERN.getBytes()).append(" cs ").append(name.getBytes()).append(" scn").append_i(separator);
  ColorDetails details = shading.getColorDetails();
  if (details != null)
    prs.addColor(details.getColorName(), details.getIndirectReference());
}
origin: es.gob.afirma/afirma-crypto-pdf-itext

/** Sets the fill color to an uncolored pattern.
 * @param p the pattern
 * @param color the color of the pattern
 * @param tint the tint if the color is a spot color, ignored otherwise
 */
public void setPatternFill(PdfPatternPainter p, Color color, float tint) {
  checkWriter();
  if (!p.isStencil())
    throw new RuntimeException("An uncolored pattern was expected.");
  PageResources prs = getPageResources();
  PdfName name = writer.addSimplePattern(p);
  name = prs.addPattern(name, p.getIndirectReference());
  ColorDetails csDetail = writer.addSimplePatternColorspace(color);
  PdfName cName = prs.addColor(csDetail.getColorName(), csDetail.getIndirectReference());
  content.append(cName.getBytes()).append(" cs").append_i(separator);
  outputColorNumbers(color, tint);
  content.append(' ').append(name.getBytes()).append(" scn").append_i(separator);
}
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/** Sets the fill color to an uncolored pattern.
 * @param p the pattern
 * @param color the color of the pattern
 * @param tint the tint if the color is a spot color, ignored otherwise
 */
public void setPatternFill(PdfPatternPainter p, Color color, float tint) {
  checkWriter();
  if (!p.isStencil())
    throw new RuntimeException(MessageLocalization.getComposedMessage("an.uncolored.pattern.was.expected"));
  PageResources prs = getPageResources();
  PdfName name = writer.addSimplePattern(p);
  name = prs.addPattern(name, p.getIndirectReference());
  ColorDetails csDetail = writer.addSimplePatternColorspace(color);
  PdfName cName = prs.addColor(csDetail.getColorName(), csDetail.getIndirectReference());
  content.append(cName.getBytes()).append(" cs").append_i(separator);
  outputColorNumbers(color, tint);
  content.append(' ').append(name.getBytes()).append(" scn").append_i(separator);
}
origin: com.github.librepdf/openpdf

/** Sets the fill color to an uncolored pattern.
 * @param p the pattern
 * @param color the color of the pattern
 * @param tint the tint if the color is a spot color, ignored otherwise
 */
public void setPatternFill(PdfPatternPainter p, Color color, float tint) {
  checkWriter();
  if (!p.isStencil())
    throw new RuntimeException(MessageLocalization.getComposedMessage("an.uncolored.pattern.was.expected"));
  PageResources prs = getPageResources();
  PdfName name = writer.addSimplePattern(p);
  name = prs.addPattern(name, p.getIndirectReference());
  ColorDetails csDetail = writer.addSimplePatternColorspace(color);
  PdfName cName = prs.addColor(csDetail.getColorName(), csDetail.getIndirectReference());
  content.append(cName.getBytes()).append(" cs").append_i(separator);
  outputColorNumbers(color, tint);
  content.append(' ').append(name.getBytes()).append(" scn").append_i(separator);
}
origin: com.github.librepdf/openpdf

/** Sets the stroke color to an uncolored pattern.
 * @param p the pattern
 * @param color the color of the pattern
 * @param tint the tint if the color is a spot color, ignored otherwise
 */
public void setPatternStroke(PdfPatternPainter p, Color color, float tint) {
  checkWriter();
  if (!p.isStencil())
    throw new RuntimeException(MessageLocalization.getComposedMessage("an.uncolored.pattern.was.expected"));
  PageResources prs = getPageResources();
  PdfName name = writer.addSimplePattern(p);
  name = prs.addPattern(name, p.getIndirectReference());
  ColorDetails csDetail = writer.addSimplePatternColorspace(color);
  PdfName cName = prs.addColor(csDetail.getColorName(), csDetail.getIndirectReference());
  content.append(cName.getBytes()).append(" CS").append_i(separator);
  outputColorNumbers(color, tint);
  content.append(' ').append(name.getBytes()).append(" SCN").append_i(separator);
}
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/** Sets the stroke color to an uncolored pattern.
 * @param p the pattern
 * @param color the color of the pattern
 * @param tint the tint if the color is a spot color, ignored otherwise
 */
public void setPatternStroke(PdfPatternPainter p, Color color, float tint) {
  checkWriter();
  if (!p.isStencil())
    throw new RuntimeException(MessageLocalization.getComposedMessage("an.uncolored.pattern.was.expected"));
  PageResources prs = getPageResources();
  PdfName name = writer.addSimplePattern(p);
  name = prs.addPattern(name, p.getIndirectReference());
  ColorDetails csDetail = writer.addSimplePatternColorspace(color);
  PdfName cName = prs.addColor(csDetail.getColorName(), csDetail.getIndirectReference());
  content.append(cName.getBytes()).append(" CS").append_i(separator);
  outputColorNumbers(color, tint);
  content.append(' ').append(name.getBytes()).append(" SCN").append_i(separator);
}
com.lowagie.text.pdfPageResourcesaddColor

Popular methods of PageResources

  • <init>
  • addDefaultColor
  • addDefaultColorDiff
  • addExtGState
  • addFont
  • addPattern
  • addProperty
  • addShading
  • addXObject
  • getResources
  • hasResources
  • setOriginalResources
  • hasResources,
  • setOriginalResources,
  • translateName

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now