/** 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(final PdfPatternPainter p, final BaseColor color, final 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.getColorSpaceName(), csDetail.getIndirectReference()); saveColor(new UncoloredPattern(p, color, tint), true); content.append(cName.getBytes()).append(" cs").append_i(separator); outputColorNumbers(color, tint); content.append(' ').append(name.getBytes()).append(" scn").append_i(separator); }
/** 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(final PdfPatternPainter p, final BaseColor color, final 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.getColorSpaceName(), csDetail.getIndirectReference()); saveColor(new UncoloredPattern(p, color, tint), false); content.append(cName.getBytes()).append(" CS").append_i(separator); outputColorNumbers(color, tint); content.append(' ').append(name.getBytes()).append(" SCN").append_i(separator); }
/** 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(final PdfPatternPainter p, final BaseColor color, final 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.getColorSpaceName(), csDetail.getIndirectReference()); saveColor(new UncoloredPattern(p, color, tint), true); content.append(cName.getBytes()).append(" cs").append_i(separator); outputColorNumbers(color, tint); content.append(' ').append(name.getBytes()).append(" scn").append_i(separator); }
/** 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(final PdfPatternPainter p, final BaseColor color, final 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.getColorSpaceName(), csDetail.getIndirectReference()); saveColor(new UncoloredPattern(p, color, tint), false); content.append(cName.getBytes()).append(" CS").append_i(separator); outputColorNumbers(color, tint); content.append(' ').append(name.getBytes()).append(" SCN").append_i(separator); }