Viewing 1 post (of 1 total)
  • Author
    Posts
  • #26962

    Dear support,
    We have faced with the following problem:

    Precondition. Our system provides printing capabilities for label printers. Label page size, margins (aka insets), font-size and font (aka font-family) are all the params which are set dynamically. Font-size is set on html level.

    Problem. Specified font-size is not kept at all and we created a formula, which generates appropriate userWidth( setHtmlWidth ) to maintain specified font-size.
    public static final long getCalucaltedHtmlWidth (int leftMarginMM, int rightMarginMM, int pageWidth, int fontSize){<br /> double weight = 13.7;<br /> double fontSizeKoef = (1 - fontSize*1.0/8 )* weight +16;<br /> return Math.round(fontSizeKoef*(pageWidth - leftMarginMM - rightMarginMM)/PD4Constants.TRANSLATE_FACTOR);<br /> }

    All the constants were defined experimentally. We tried protectPhysicalUnitDimensions() method to let pd4ml do stuff for us, but for some reasons it had no impact on maintaining predefined font-size.

    Please advice if there is any better approach than temporary solution chosen at the moment,

    thanks,

Viewing 1 post (of 1 total)

The forum ‘Troubleshooting’ is closed to new topics and replies.