Thank you will give it a try.
From: Attila Kiss [mailto:[email protected]]
Sent: Thursday, 12 January 2017 5:28 PM
To: [email protected]; Shivangi Singal
<[email protected]>
Subject: Re: PDFBox and Dimension
Hello,
I do not know if it is the perfect way, but I use this:
public class PDUnitsConverter {
private static final float POINTS_PER_INCH = 72;
private static final float MM_PER_INCH = 1 / (10 * 2.54f) * POINTS_PER_INCH;
private PDUnitsConverter() {
}
public static float convertMMToUnits(float mm) {
return mm * MM_PER_INCH;
}
public static float convertUnitsToMM(float unit) {
return unit / MM_PER_INCH;
}
}
If you need a 148 mm horizontal line:
moveTo(x,y); //start point of the line
//if the line is horizontal
lineTo(PDUnitsConverter.convertMMToUnits(148), y);
I hope it helps.
Attila
2017-01-12 5:22 GMT+01:00 Shivangi Singal
<[email protected]<mailto:[email protected]>>:
Hello,
To draw a line I am using moveTo and lineTo , which is working fine .
But If I have to draw a line which is 148 mm in dimension what would be the
best way to do that ?
Do I need experiment with x and y coordinates to reach exact measurement or is
there any more better way ?
Will really appreciate your help.
Thanks,
Shivangi
Shivangi Singal
Developer
P: +61 3 9326 7422<tel:+61%203%209326%207422>
M: +61 421 996 537<tel:+61%20421%20996%20537>
[email protected]<mailto:[email protected]>
www.microlistics.com.au<http://www.microlistics.com.au>