We're sorry Aspose doesn't work properply without JavaScript enabled.

Pdf Generator Line

I'm having hard time drawing a line

could u someone help me understanded the properties of Line position?

Currently i have a line in crystal reports and length is

X(left margin)= 0.000inch

Y(Top margin)= 2.250inch

Height= 10.660inch

Width= 0.040inch

Line thickness = 3.5pt.

Whats the equivalent in Aspose for creating a line?

Thanks

Thanks for using our products.

As per my understanding, you might be facing an issue while convert Inc to points because the basic unit of drawing line is point. Furthermore, in order to specify the dimensions of line object, you need to use floating array which contains the coordinates where line will be drawn. Please take a look over following code snippet to draw line with the width of 3.5f and height as 10.66 Inch.

[C#]

// instantiate PDF object<o:p></o:p>

Pdf pdf1 = new Pdf();

// add section to PDF file

Graph graph1 = new Graph(sec1, 200, 767);

// draw a line starting at X=10 and Top of line is 767 (10.66Inch)

float[] posArr = new float[] { 10, 200, 10, 767 };

Line l1 = new Line(graph1, posArr);

// specify the width of line

l1.GraphInfo.LineWidth = 3.5f;

// set the color for line object

l1.GraphInfo.Color = new Aspose.Pdf.Generator.Color("Red");

// save PDF document

pdf1.Save(“c:/pdftest/LineInPdf.pdf”);

For your reference, I have also attached the resultant PDF generated over my end. For further information on unit conversion from Inch to Point, please visit Tips and Tricks

Could u please explain what does these 4 floating values represents?

float[] posArr = new float[] { 10, 200, 10, 767 };

1st value represents x position?

2nd value?

3rd value?Width?

4th value?Height?

Thanks

<?XML:NAMESPACE PREFIX = O />

Could u please explain what does these 4 floating values represents?

float[] posArr = new float[] { 10, 200, 10, 767 };