sivarajankumar / alivepdf

Automatically exported from code.google.com/p/alivepdf
0 stars 0 forks source link

Drawing non-closed shapes - how? #81

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Maybe am missing something obvious but I'm not finding an intuitive way of
drawing shapes that are not to be closed. This relates to the issue of not
being able to change lineStyle when drawing complex shapes also. It seems
that in order to be able to change lineStyle one must call the end()
function (is there another way?) BUT the end function doesn't just finish
this drawing move but also ADDS a line back to the beginning. The only way
I have found so far to actually lift the pen and change the ink as it were
is to insert a moveTo (any point) statement before the end call. That seems
to confuse the app enough to not close the shape with the end call. 

I'm guessing there are other ways of accomplishing this, but then again I
realised all examples mentioned use closed shapes. 

[code]
myPDF.lineStyle( new RGBColor(0x0000ff ), 2, 1, 1,
WindingRule.NON_ZERO,null,null,Caps.NONE, JointStyle.ROUND );
myPDF.moveTo( 40, 20 );
myPDF.lineTo( 40, 40 );
myPDF.lineTo( 10, 40 );
myPDF.lineTo( 100, 20 );
//myPDF.moveTo( 100, 20 );//uncomment to be able to leave unclosed and
change lineStyle
myPDF.end();

myPDF.lineStyle( new RGBColor(0x330000 ), 2, 1, 1,
WindingRule.NON_ZERO,null,null,Caps.NONE, JointStyle.ROUND );
myPDF.moveTo( 140, 120 );
myPDF.lineTo( 140, 140 );
myPDF.lineTo( 110, 140 );
myPDF.lineTo( 100, 120 );
//myPDF.moveTo( 100, 120 );
myPDF.end();
[/code]

Ver. 1.4.5
All the best
/borg

Original issue reported on code.google.com by andreas....@gmail.com on 18 Sep 2008 at 9:03

GoogleCodeExporter commented 8 years ago
Hi andreas,

I am investigating this, thanks for tracking this behavior.
I will post an update as soon as I include such a feature.

best,

Thibault

Original comment by thibault.imbert on 1 Oct 2008 at 8:09