Convert to PDF with reading CTB and assign properties
![]() 12/22/2023 3:54 AM
|
---|
I have DWG file and I would like to know ,
It is possible to convert to PDF with reading CTB file and assign properties while converting to PDF.
|
![]() 1/10/2024 1:44 AM
|
---|
Please help!
|
![]() 1/10/2024 2:46 PM
|
---|
Hi,
I've just improved support for CTB files: I've added method CtbFile.GetPlotStyle(IPlotPropertyOwner plotPropertyOwner, DrawContext drawContext), which you can assign to property GraphicsConfig.PlotStyleManager. Currently only color and line weight overrides are implemented.
I have briefly tested with your test files, see example code below (you'll need to get the PdfExporterExample code from the Examples directory in the latest CadLib version):
C# Code: WW. |
![]() 1/17/2024 3:32 AM
|
---|
Hi, I'm download latest version 4.0.2024.1121 but can't use function WW.Cad.Examples.PdfExportOptions
|
![]() 1/17/2024 3:46 AM
|
---|
Imports WW.Cad
Is there anything missing from the new version?
best regards;
ABS
|
![]() 1/17/2024 11:13 AM
|
---|
Hi,
It's part of the C# example in Examples\PdfExportExampleCS, there is no VB version of this. You can just assign ctbFile.GetPlotStyle to GraphicsConfig.PlotStyleManager, this is the only important part.
- Wout
|
![]() 1/18/2024 7:15 AM
|
---|
Hi wout,
thank you for your reply. but, we still have problem. I have assigned to GraphicsConf.PlotStyleManager = ctbFile.GetPlotStyle . It does not works, here my coding
Dim to2DTransform As Matrix4D = DxfUtil.GetScaleTransform(
bounds.Corner1,
bounds.Corner2, New WW.Math.Point3D(bounds.Center.X, bounds.Corner2.Y, 0.0),
New WW.Math.Point3D(New Vector3D(margin, margin, 0.0) * PdfExporter.InchToPixel),
New WW.Math.Point3D(New Vector3D(pageWidth - margin, pageHeight - margin, 0.0) * PdfExporter.InchToPixel),
New WW.Math.Point3D(New Vector3D(pageWidth / 2.0, pageHeight - margin, 0.0) * PdfExporter.InchToPixel), scaling)
'create a stream to put the transformed model into
Using ms As Stream = File.Create(strPDFFileName)
'create the pdf container with the empty stream
Dim pdf As New WW.Cad.IO.PdfExporter(ms)
Dim GraphicsConf As GraphicsConfig = DirectCast(GraphicsConfig.WhiteBackgroundCorrectForBackColor.Clone(), GraphicsConfig)
GraphicsConf.ApplyLineType = True
GraphicsConf.TryDrawingTextAsText = True
GraphicsConf.DrawImages = True
GraphicsConf.DisplayLineTypeElementShapes = True
' Already scaled to PDF pixels, so can directly use the scaling variable.
GraphicsConf.DotsPerInch = CSng(scaling)
Dim ctbFile As WW.Cad.Drawing.CtbFile = New WW.Cad.Drawing.CtbFile("D:\support\abs\1\CTB\P&ID COLOR - A1.ctb")
GraphicsConf.PlotStyleManager = ctbFile.GetPlotStyle
'draw the model into the pdf containers stream
pdf.ExportLayers = True
pdf.EmbedFonts = True
pdf.DrawPage(m_CADModel, GraphicsConf, to2DTransform, paperSize)
'create the pdf
pdf.EndDocument()
ms.Close()
End Using
need help!
best regards;
ABS
|
![]() 1/18/2024 9:25 AM
|
---|
Hi,
Please order a support ticket here, it was a few hours of work supporting this feature.
- Wout
|
![]() 1/23/2024 11:58 AM
|
---|
As you suddenly have lost interest in this feature I will be removing this again by the end of the week.
- Wout
|
![]() 1/25/2024 2:41 AM
|
---|
Hi Woutware,
Yes, we are interested in this feature. Please support us for VB version.
Best regards;
Ji
|