TTMSFMXPDFLib how to convert pixels to mm

Using TTMSFMXPDFLib,

How do I convert from canvas pixel coordinates to physical mm coordinates for a PDF document ?

I want to create a A4 PDF document that starting from top/left of the page 10mm across and 10mm down draw a rectangle excatly 60mm across by 60mm down with a frame width of 1mm

Given that it uses canvas and pixels and NOT mm , how do I convert from mm to pixels / vice-versa?

Cheers

There are a set of conversion routines:


MillimeterToPixel
PixelToMillimeter

Inside the FMX.TMSPDFLib unit


Pieter Scheldeman2020-01-30 16:56:14

Many thanks!

OK, 

Found out why I can't get my rectangles to appear on the page as I thought I was specifying.
The reason is the Default page size, which the documentation says is A4 is actually US Letter

Hence my design based on a page size of A4 (210mm x 297mm / 8.27" x 11.69") 
looks strange when the actual default pagesize is in-fact US Letter size (216mm x 279mm / 8 1/2" x 11")