Hello Heiko > "%.4g" allows the "e style", you get invalid PDF, if scalefactor > is equal smaller than 0.000099995 (e.g. 0,00009 => 9e-05) or > equal/greater than 9999.5 (e.g. 10000 => 1e+04). > PDF numbers must not be given in exponential notation.
Yes thanks! I wonder how many times I will run into that. Now I round the value. >> local hbox = node.hpack(box) >> hbox = node.insert_before(hbox,hbox,pdf_setmatrix) >> hbox = node.insert_before(hbox,pdf_setmatrix,pdf_save) >> >> hbox = node.hpack(hbox) >> hbox.height = box.height * scalefactor >> hbox.width = box.width * scalefactor >> hbox.depth = 0 >> node.insert_after(hbox,node.tail(hbox),pdf_restore) >> >> local newbox = node.vpack(hbox) >> return newbox >> end >> >> which seems to work because the box doesn't have any depth. > > The original box might have a depth. The other parameters (width and > height) are recalculated, but the depth is set to zero? yes, explicitly in the code above. Now it's a vertical list with hbox dp 0 that has "save, matrix, some material" and then the restore, which ends up at the same place at save. Patrick
