Skip to content

questions about printformlib

Forums Forums SIMPOL Programming questions about printformlib

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #218
    Jim Locker
    Member

    Getting printformlib running was quite easy, but it isn’t printing a faithful replica of the form. When I read the code, I find these lines in the renderwxform routine: width = convert_dpi_mcm(c.width * 12 / 10, dpi) height = convert_dpi_mcm(c.height * 12 / 10, dpi) Why the scaling of 12/10? This does appear to be what is causing my forms to render wrong. Also, fonts are printing larger than defined; this probably is the scaling thing also, but that kind of surprises me; I would expect fonts to print at the specified size regardless.

    #1469
    Michael
    Keymaster

    On 08/04/2010 21:01, jim wrote:
    > Getting printformlib running was quite easy, but it isn't printing a
    > faithful replica of the form.

    Hi Jim,

    This is a fairly early attempt. The real problem is that the pixel
    values are being converted to micrometers. Doing that is always going to
    result in trouble, and I was not happy with the quality yet.

    > When I read the code, I find these lines in the renderwxform
    > routine:
    >
    > width = convert_dpi_mcm(c.width * 12 / 10, dpi) height =
    > convert_dpi_mcm(c.height * 12 / 10, dpi)
    >
    > Why the scaling of 12/10? This does appear to be what is causing my
    > forms to render wrong.

    I think I was tweaking things here and finding that without the fudge
    factor, the text was not rendering the right size either.

    > Also, fonts are printing larger than defined; this probably is the
    > scaling thing also, but that kind of surprises me; I would expect
    > fonts to print at the specified size regardless.
    >

    Fonts should print at the stated size. If they are not printing at the
    right size, that needs investigation, but I fear the problem for that
    may be buried in the wxWidgets library, not in our stuff.

    The best approach for the print forms is to use the correct units when
    creating the form, and have them stored in some way so that they can be
    used for rendering the form directly to print. I am thinking about the
    best way of doing that.

    Ideally the best approach would be to allow the use of micrometers in
    the form designer, and simply calculate the pixel positions of the
    controls by converting from the micrometer units. Then I would need a
    way of storing the micrometer values for each control or graphic. This
    is some of the last things still to be done in the form designer.

    I am currently working my way through the report engine, and finding
    some useful ways to incorporate it in normal code. The engine is layerd,
    with different APIs for different types of functionality.

    I am also implementing a new detail block type: unlinked but using a
    SQL92 query to define the result set for the master table.

    Ciao, Neil

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.