Android Code Snippet PDF: simple conversion routines

SubName: PointsToCms and CmsToPoints

Author: "LucaMs"

Description: two simple conversion routines PostScript points/centimeters

Code:
B4X:
Sub PointsToCms(Points As Double) As Double
    Return (Points / 72) * 2.54
End Sub

Sub CmsToPoints(Cms As Double) As Double
    Return (Cms / 2.54) * 72
End Sub

Dependencies: None


Note:
1 inch = 72 PostScript points.
I'm italian, so I prefer cms. 1 inch = 2.54 cm

Perhaps a complete converter would be useful (?)


Tags: PostScript, point, cm, centimeter, convert, PDF
 
Top