Example usage for com.itextpdf.text.pdf PdfLiteral PdfLiteral

List of usage examples for com.itextpdf.text.pdf PdfLiteral PdfLiteral

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfLiteral PdfLiteral.

Prototype

public PdfLiteral(int size) 

Source Link

Usage

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);
    }//from  ww w. j  a v  a2  s.  com

    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);
}

From source file:mkl.testarea.itext5.pdfcleanup.PdfCleanUpContext.java

License:Open Source License

public PdfCleanUpContext() {
    List<PdfObject> initialStrokeColor = new ArrayList<PdfObject>(
            Arrays.asList(PdfName.DEVICEGRAY, new PdfLiteral("CS")));
    strokeColorOperands = new Stack<List<PdfObject>>();
    strokeColorOperands.push(initialStrokeColor);
}