Android Code Snippet PDF: simple conversion routines

Discussion in 'Code Snippets' started by LucaMs, May 4, 2015.

  1. LucaMs

    LucaMs Expert Licensed User

    SubName: PointsToCms and CmsToPoints

    Author: "LucaMs"

    Description: two simple conversion routines PostScript points/centimeters

    Code:
    Code:
    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
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice