Frame in pdf-file

Posted by: r.trofymchuk on 30 April 2024, 3:42 am EST

  • Posted 30 April 2024, 3:42 am EST - Updated 30 April 2024, 3:56 am EST

    Hi guys,

    I have a problem with creating the PDF file. I am trying to create a PDF file that should contain a graphical frame. I deliberately simplified the code to illustrate the problem. On my PC, the frame is drawn correctly(testOk.pdf). However, on some of my employees’ PCs, the frame is displayed incorrectly (shifted to the left and up - test.dpf). I don’t understand what could be causing this.

    I am using the 4.8 framework. The version of the controls is 4.8.20223.584. The system is Windows 11 Pro.

    [code]

    Imports System.Drawing

    Module Module1

    Sub Main()

      Dim kX_frame As Integer = 5
      Dim kY_frame As Integer = 5
      Dim oPrnDoc As New C1.C1Preview.C1PrintDocument
    
      oPrnDoc.Clear()
      oPrnDoc.DefaultUnit = C1.C1Preview.UnitTypeEnum.Mm
      oPrnDoc.ResolvedUnit = C1.C1Preview.UnitTypeEnum.Mm
    
      'default option
      oPrnDoc.PageLayout.PageSettings.PaperKind = Printing.PaperKind.A4
      oPrnDoc.PageLayout.PageSettings.Landscape = False
    
      'Margin Letter A4
      oPrnDoc.PageLayout.PageSettings.LeftMargin = kX_frame
      oPrnDoc.PageLayout.PageSettings.TopMargin = kY_frame
      oPrnDoc.PageLayout.PageSettings.RightMargin = kX_frame
      oPrnDoc.PageLayout.PageSettings.BottomMargin = kY_frame
    
      ' Print frame
      Dim overlay As New C1.C1Preview.RenderArea()
      overlay.Width = "100%"
      overlay.Height = "100%"
      overlay.Style.Borders.All = C1.C1Preview.LineDef.Default
    
      oPrnDoc.PageLayout.Overlay = overlay
      Dim oNewExporter As C1.C1Preview.Export.Exporter = oPrnDoc.ExportProviders(1).NewExporter 'pdf
      oPrnDoc.Generate()
    
      oNewExporter.ShowOptions = False
      oNewExporter.Range = New C1.C1Preview.OutputRange(oPrnDoc.Pages.MinPageNo, oPrnDoc.Pages.MaxPageNo)
      oNewExporter.Document = oPrnDoc.Document
      oNewExporter.DocumentInfo = oPrnDoc.DocumentInfo
      oNewExporter.Export(AppDomain.CurrentDomain.BaseDirectory & "\" & "test.pdf")
    

    End Sub

    End Module[/code]TestPDF_Creater.zip

  • Posted 30 April 2024, 3:45 am EST

    sample files:Examples.zip

  • Posted 30 April 2024, 9:18 pm EST

    Hello,

    Thank you for sharing the PDFs and stripped-down sample.

    We tested your sample with the mentioned version of the C1 controls in Windows 11 but could not replicate the behavior. The frame in PDf is rendered properly in the middle, as in your testOK.pdf.

    Could you please test your project with the latest version of C1Controls [2023v3 hotfix-2 (643)] to see if the behavior persists?

    As you have mentioned that the behavior is observable on only some of your employee’s machines, could you please check if there are any differences between your machine and the employees’ machines that might be causing this behavior? Also, please share the details (like OS version, screen resolution, CPU, memory, etc.) of those machines so that we can observe and investigate the behavior on our end.

    Regards,

    Uttkarsh.

  • Posted 1 May 2024, 12:23 am EST - Updated 1 May 2024, 7:22 pm EST

    I have already installed the latest version (4.8.20233.631) of components. Unfortunately, it has not helped. I have only noticed that when I run the program on my colleague’s PC via Remote Desktop, a file with correct frames is created. When the program is started directly on the PC, an incorrect frame is drawn.

    There are several PCs (at least 5 PCs) that have this problem.

    I am almost certain that the problem only appears on PCs with Windows 10.

    System information from one PC:

    (Screen resolution 1920*1080 -The resolution is the same as mine)

    Memory size 16GB

  • Posted 2 May 2024, 12:03 am EST

    Hello,

    Thank you for sharing more information. We were able to replicate this behavior on our end by running your sample on a remote Win10 machine and a normal Win10 machine. It is replicable on few of the machines only.

    We have escalated this behavior to the developers to get their insights. Rest assured, as soon as we get any necessary information, we’ll get back to you.

    [Internal Tracking ID: C1WIN-32042]

    Regards,

    Uttkarsh.

Need extra support?

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

Learn More

Forum Channels