List of usage examples for com.itextpdf.text.pdf PdfName toPdf
public void toPdf(PdfWriter writer, OutputStream os) throws IOException
PdfObject
as an array of byte
s to the writer. From source file:mkl.testarea.itext5.pdfcleanup.PdfCleanUpContentOperator.java
License:Open Source License
private void writeStroke(PdfContentByte canvas, Path path, PdfName strokeColorSpace) throws IOException { canvas.getInternalBuffer().append(q); if (strokeColorSpace != null) { strokeColorSpace.toPdf(canvas.getPdfWriter(), canvas.getInternalBuffer()); canvas.getInternalBuffer().append(' ').append(cs); }// w w w .java 2s. c o m List<PdfObject> strokeColorOperands = cleanUpStrategy.getContext().peekStrokeColor(); String strokeOperatorStr = strokeColorOperands.get(strokeColorOperands.size() - 1).toString(); // Below expression converts stroke color operator to its fill analogue. strokeColorOperands.set(strokeColorOperands.size() - 1, new PdfLiteral(strokeOperatorStr.toLowerCase())); writeOperands(canvas, strokeColorOperands); writePath(path, f, canvas); canvas.getInternalBuffer().append(Q); }