Method from org.apache.pdfbox.pdmodel.graphics.PDExtendedGraphicsState Detail: |
public void copyIntoGraphicsState(PDGraphicsState gs) throws IOException {
for( COSName key : graphicsState.keySet() )
{
if( key.equals( LW ) )
{
gs.setLineWidth( getLineWidth().doubleValue() );
}
else if( key.equals( LC ) )
{
gs.setLineCap( getLineCapStyle() );
}
else if( key.equals( LJ ) )
{
gs.setLineJoin( getLineJoinStyle() );
}
else if( key.equals( ML ) )
{
gs.setMiterLimit( getMiterLimit().doubleValue() );
}
else if( key.equals( D ) )
{
gs.setLineDashPattern( getLineDashPattern() );
}
else if( key.equals( RI ) )
{
gs.setRenderingIntent( getRenderingIntent() );
}
else if( key.equals( OPM ) )
{
gs.setOverprintMode( getOverprintMode().doubleValue() );
}
else if( key.equals( FONT ) )
{
PDFontSetting setting = getFontSetting();
gs.getTextState().setFont( setting.getFont() );
gs.getTextState().setFontSize( setting.getFontSize() );
}
else if( key.equals( FL ) )
{
gs.setFlatness( getFlatnessTolerance().floatValue() );
}
else if( key.equals( SM ) )
{
gs.setSmoothness( getSmoothnessTolerance().floatValue() );
}
else if( key.equals( SA ) )
{
gs.setStrokeAdjustment( getAutomaticStrokeAdjustment() );
}
else if( key.equals( CA ) )
{
gs.setAlphaConstants( getStrokingAlpaConstant().floatValue() );
}/**
else if( key.equals( CA_NS ) )
{
}**/
else if( key.equals( AIS ) )
{
gs.setAlphaSource( getAlphaSourceFlag() );
}
else if( key.equals( TK ) )
{
gs.getTextState().setKnockoutFlag( getTextKnockoutFlag() );
}
}
}
This will implement the gs operator. |
public boolean getAlphaSourceFlag() {
return graphicsState.getBoolean( AIS, false );
}
This will get the alpha source flag. |
public boolean getAutomaticStrokeAdjustment() {
return graphicsState.getBoolean( SA,false );
}
This will get the automatic stroke adjustment flag. |
public COSDictionary getCOSDictionary() {
return graphicsState;
}
This will get the underlying dictionary that this class acts on. |
public COSBase getCOSObject() {
return graphicsState;
}
Convert this standard java object to a COS object. |
public Float getFlatnessTolerance() {
return getFloatItem( FL );
}
This will get the flatness tolerance. |
public PDFontSetting getFontSetting() {
PDFontSetting setting = null;
COSArray font = (COSArray)graphicsState.getDictionaryObject( FONT );
if( font != null )
{
setting = new PDFontSetting( font );
}
return setting;
}
This will get the font setting of the graphics state. |
public int getLineCapStyle() {
return graphicsState.getInt( LC );
}
This will get the line cap style. |
public PDLineDashPattern getLineDashPattern() {
PDLineDashPattern retval = null;
COSArray dp = (COSArray)graphicsState.getDictionaryObject( D );
if( dp != null )
{
retval = new PDLineDashPattern( dp );
}
return retval;
}
This will get the dash pattern. |
public int getLineJoinStyle() {
return graphicsState.getInt( LJ );
}
This will get the line join style. |
public Float getLineWidth() {
return getFloatItem( LW );
}
This will get the line width. This will return null if there is no line width |
public Float getMiterLimit() {
return getFloatItem( ML );
}
This will get the miter limit. |
public Float getNonStrokingAlpaConstant() {
return getFloatItem( CA_NS );
}
This will get the non stroking alpha constant. |
public boolean getNonStrokingOverprintControl() {
return graphicsState.getBoolean( OP_NS, getStrokingOverprintControl() );
}
This will get the overprint control for non stroking operations. If this
value is null then the regular overprint control value will be returned. |
public Float getOverprintMode() {
return getFloatItem( OPM );
}
This will get the overprint control mode. |
public String getRenderingIntent() {
return graphicsState.getNameAsString( "RI" );
}
This will get the rendering intent. |
public Float getSmoothnessTolerance() {
return getFloatItem( SM );
}
This will get the smothness tolerance. |
public Float getStrokingAlpaConstant() {
return getFloatItem( CA );
}
This will get the stroking alpha constant. |
public boolean getStrokingOverprintControl() {
return graphicsState.getBoolean( OP, false );
}
This will get the overprint control. |
public boolean getTextKnockoutFlag() {
return graphicsState.getBoolean( TK,true );
}
This will get the text knockout flag. |
public void setAlphaSourceFlag(boolean alpha) {
graphicsState.setBoolean( AIS, alpha );
}
This will get the alpha source flag. |
public void setAutomaticStrokeAdjustment(boolean sa) {
graphicsState.setBoolean( SA, sa );
}
This will get the automatic stroke adjustment flag. |
public void setFlatnessTolerance(Float flatness) {
setFloatItem( FL, flatness );
}
This will get the flatness tolerance. |
public void setFontSetting(PDFontSetting fs) {
graphicsState.setItem( FONT, fs );
}
This will set the font setting for this graphics state. |
public void setLineCapStyle(int style) {
graphicsState.setInt( LC, style );
}
This will set the line cap style for the graphics state. |
public void setLineDashPattern(PDLineDashPattern dashPattern) {
graphicsState.setItem( D, dashPattern.getCOSObject() );
}
This will set the dash pattern for the graphics state. |
public void setLineJoinStyle(int style) {
graphicsState.setInt( LJ, style );
}
This will set the line join style. |
public void setLineWidth(Float width) {
setFloatItem( LW, width );
}
This will set the line width. |
public void setMiterLimit(Float miterLimit) {
setFloatItem( ML, miterLimit );
}
This will set the miter limit for the graphics state. |
public void setNonStrokingAlphaConstant(Float alpha) {
setFloatItem( CA_NS, alpha );
}
This will get the non stroking alpha constant. |
public void setNonStrokingOverprintControl(boolean op) {
graphicsState.setBoolean( OP_NS, op );
}
This will get the overprint control(OP). |
public void setOverprintMode(Float overprintMode) {
setFloatItem( OPM, overprintMode );
}
This will get the overprint mode(OPM). |
public void setRenderingIntent(String ri) {
graphicsState.setName( "RI", ri );
}
This will set the rendering intent for the graphics state. |
public void setSmoothnessTolerance(Float smoothness) {
setFloatItem( SM, smoothness );
}
This will get the smoothness tolerance. |
public void setStrokingAlphaConstant(Float alpha) {
setFloatItem( CA, alpha );
}
This will get the stroking alpha constant. |
public void setStrokingOverprintControl(boolean op) {
graphicsState.setBoolean( OP, op );
}
This will get the overprint control(OP). |
public void setTextKnockoutFlag(boolean tk) {
graphicsState.setBoolean( TK, tk );
}
This will get the text knockout flag. |