int fillType = gs.getFillType();
if(fillType==GraphicsState.FILL || fillType==GraphicsState.FILLSTROKE) {
PdfPaint col = gs.getNonstrokeColor();
String hexColor = hexColor(col);
// if(isSinglePixelFill){ //special case to make sure appears in javaFx if w or h of shape is 1
// pathCommands.add("\tpath_"+shapeCount+".setStroke(Color."+ rgbToCSSColor(col.getRGB()) + ");");
setStrokeColor=true;
if(setStrokeColor)
strokeColor = " stroke="+"\""+hexColor+"\"";
// }else{ //add new fillStyle only if color changed
// if(col.getRGB() != currentColor) {
// pathCommands.add("\tpath_"+shapeCount+".setFill(Color."+ rgbToCSSColor(col.getRGB()) + ");");
currentColor = col.getRGB();
setFillColor=true;
if(setFillColor)
fillColor = " fill="+"\""+hexColor+"\"";
// }
// pathCommands.add("\tpath_"+shapeCount+".setFill(Color."+ rgbToCSSColor(col.getRGB()) + ");");
}
// }
if(fillType==GraphicsState.STROKE || fillType==GraphicsState.FILLSTROKE) {
BasicStroke stroke = (BasicStroke) gs.getStroke();
if(stroke.getLineWidth()!=1) { //attribute double lineWidth; (default 1)
// pathCommands.add("\tpath_"+shapeCount+".setStrokeWidth(" + ((double) stroke.getLineWidth()*scaling) + ");");
setStrokeWidth=true;
if(setStrokeWidth)
strokeWidth = " strokeWidth="+"\""+((double) stroke.getLineWidth()*scaling)+"\"";
}
if(stroke.getMiterLimit()!=10) { //attribute double miterLimit; // (default 10)
// pathCommands.add("\tpath_"+shapeCount+".setStrokeMiterLimit(" + ((double) stroke.getLineWidth()*scaling) + ");");
setStrokeMiterLimit=true;
if(setStrokeMiterLimit)
strokeMiterLimit = " strokeMiterLimit="+"\""+((double) stroke.getLineWidth()*scaling)+"\"";
}
// pathCommands.add("\tpath_"+shapeCount+".setStrokeLineCap(StrokeLineCap." + determineLineCap(stroke) + ");");
setStrokeLineCap=true;
if(setStrokeLineCap)
strokeLineCap = " strokeLineCap="+"\""+ determineLineCap(stroke) +"\"";
// pathCommands.add("\tpath_"+shapeCount+".setStrokeLineJoin(StrokeLineJoin." + determineLineJoin(stroke) + ");");
setStrokeLineJoin=true;
if(setStrokeLineJoin)
strokeLineJoin = " strokeLineJoin="+"\""+ determineLineJoin(stroke) +"\"";
PdfPaint col = gs.getStrokeColor();
String hexColor = hexColor(col);
// pathCommands.add("\tpath_"+shapeCount+".setStroke(Color."+ rgbToCSSColor(col.getRGB()) + ");");