java - PDF page size is not exact the one provided -
i need create pdf itext fixed dimensions:
height: 95 mm = 3.74 in
width: 50 mm = 1.96 in
so i've done in code:
float width = mmtopt(95); float height = mmtopt(50); rectangle rectanglepage = new rectangle(width, height); document document = new document(rectanglepage, 0, 0, 0, 0);
where mmtopt() function (according documentation 70pt=1in=2.54cm):
public static float mmtopt(float mm){ //70pt = 25.4mm return ((70f * mm) / 25.4f); }
the problem when open pdf generated going file/properties can see says page size 3.64 x 1.91 in. not exact size i'm setting (it's 2 or 3 mm shorter - though it's little it's important because file must have dimensions).
what can happening? how can solve problem?
thanks.
it's 72 dots == 1 inch, not 70.
Comments
Post a Comment