cart: empty [ Login ]

Text not printed correctly in PDF

1 
Bogdan Eremia
1/29/2019 12:44 PM
Hello, I have a text in the attached DWG that is not printed correctly when generating a PDF from it. Please see the code below on how the PDF is generated and the attached DWG file for the actual file. Please let me know if you find something.
C# Code:
string exldDwg = Path.Combine(folder, "1_LAY.DWG"); DxfModel model = DwgReader.Read(exldDwg); var layout = model.Layouts["ESPrintPareLayout"]; BoundsCalculator boundsCalculator = new BoundsCalculator(); boundsCalculator.GetBounds(model, layout); Bounds3D bounds = boundsCalculator.Bounds; //PaperSize paperSize = PaperSizes.GetPaperSize(ppKnd); // Lengths in inches. float pageWidth = (float)paperSize.Width / 100f; float pageHeight = (float)paperSize.Height / 100f; float margin = 0.0f; double scaling; Matrix4D to2DTransform = DxfUtil.GetScaleTransform( bounds.Corner1, bounds.Corner2, new Point3D(bounds.Center.X, bounds.Corner2.Y, 0d), new Point3D(new Vector3D(margin, margin, 0d) * PdfExporter.InchToPixel), new Point3D(new Vector3D(pageWidth - margin, pageHeight - margin, 0d) * PdfExporter.InchToPixel), new Point3D(new Vector3D(pageWidth / 2d, pageHeight - margin, 0d) * PdfExporter.InchToPixel), out scaling); using (Stream stream = File.Create(Path.Combine(folder, "1.PDF"))) { GraphicsConfig grfCnfg = GraphicsConfig.AcadLikeWithWhiteBackground.Clone() as GraphicsConfig; grfCnfg.DefaultLineWeight = 1; grfCnfg.ApplyLineType = true; grfCnfg.TryDrawingTextAsText = true; grfCnfg.DrawImages = true; grfCnfg.DisplayLineTypeElementShapes = true; PdfExporter pdfGraphics = new PdfExporter(stream); pdfGraphics.ExportLayers = true; pdfGraphics.UseMultipleLayers = true; pdfGraphics.EmbedFonts = true; pdfGraphics.DrawPage( model, grfCnfg, to2DTransform, scaling, layout, layout.Viewports, paperSize); pdfGraphics.EndDocument(); } model.Dispose();
Layout.png
Pdf.png
Wout
1/29/2019 3:16 PM
Hi, The problem has been fixed, you can download the latest version from Your resources in your profile. Thank you for the report! - Wout
1