Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26945

    The PD4ML cookbook says:

    That makes HTML-to-PDF scale factor computed like that:
    scale = (pageFormat.width – pageInsets.left – pageInsets.right) / htmlWidth
    From the above it is obvious, that an increasing htmlWidth makes the resulting document content appears smaller.

    But the units don’t match up, as width and insets are either pts or mm, and html width is pixels (which don’t have an inherent size/measurement.)

    When I specify a 72 pt font, I can get it to render 1 inch high (from descender to ascender) if I specify letter paper, 5mm insets on both margins, and HTMLwidth of 700.
    This ends up being 86.35 DPI which doesn’t sound like a nice round number.
    Now my measurements could be off by a bit but I can’t get any “normal” dpi such as the browser default of 96dpi to come close.

    Can someone explain the actual calculation/conversion?

    #29563

    If font size precision is critical for your document, trigger

    pd4ml.protectPhysicalUnitDimensions()

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.