Print and Print preview with System Font size > 100%

Posted by: eikon2112 on 9 January 2023, 3:53 am EST

  • Posted 9 January 2023, 3:53 am EST

    This is an issue I’m having with printing from TrueDBGrid. I am setting my font manually in code like so:

    EJGrid.Font = New System.Drawing.Font("Lucida Console", 10, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

    And I am using print and print preview with the following code:

    ' Preview
    EJGrid.PrintInfo.PrintPreview()
    
    'Print
            Dim pd As PrintDialog = New PrintDialog()
    
            If pd.ShowDialog() = DialogResult.OK Then
                    EJGrid.PrintInfo.Print(pd.PrinterSettings)
    	endif
    

    My problem is that if the user has their system font size set to greater than 100%, like 125%, both the preview and the printed result has a font that is reduced in size to almost unreadable. I can’t find any DPI scaling properties for the grid or the printing. How can I ensure that my printed font always appears as it does when the system font scaling is set to 100%? Thank you

  • Posted 9 January 2023, 6:18 pm EST

    Hi,

    We tested the code you shared with the latest version of C1TrueDBGrid (4.5.20223.588), by setting the DPI scaling to 125% and 150%, but we could not see the issue on our end. FYI, a similar issue was fixed in the 2022v2 release of the C1TrueDBGrid. Therefore, we suggest that you try using your code with the latest release and see if you still face the issue.

    In your old code, you can also try setting the below property if it is available (as we are not sure about the version you are using) and see if it resolves the issue.

    C1TrueDBGrid1.PrintInfo.MeasurementDevice = C1.Win.C1TrueDBGrid.PrintInfo.MeasurementDeviceEnum.Printer

    We have also attached the sample project on which we tested the issue, along with the screenshot showing the behavior on our end. If the issue persists, please update the attached sample to show your implementation, so we can investigate further and assist you accordingly.

    Attachment: Tdbg.Printing.zip

    Kind Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels