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