Foxit PDF SDK
foxit.addon.conversion.DWG2PDFSettingData Class Reference

Inherits SystemIDisposable.

Public Types

enum  DWG2PDFColorPolicy { DWG2PDFColorPolicy.e_DWG2PDFColorPolicyNoPolicy = 0, DWG2PDFColorPolicy.e_DWG2PDFColorPolicyMono = 1, DWG2PDFColorPolicy.e_DWG2PDFColorPolicyGrayscale = 2, DWG2PDFColorPolicy.e_DWG2PDFColorPolicyIndexToBlack = 3 }
 Enumeration for color policy used for converting DWG to PDF. More...
 
enum  DWG2PDFExportFlags {
  DWG2PDFExportFlags.e_FlagEmbededTTF = 0x0001, DWG2PDFExportFlags.e_FlagTTFTextAsGeometry = 0x0002, DWG2PDFExportFlags.e_FlagSHXTextAsGeometry = 0x0004, DWG2PDFExportFlags.e_FlagSimpleGeomOptimization = 0x0008,
  DWG2PDFExportFlags.e_FlagEnableLayers = 0x0010, DWG2PDFExportFlags.e_FlagIncludeOffLayers = 0x0020, DWG2PDFExportFlags.e_FlagEmbededOptimizedTTF = 0x0040, DWG2PDFExportFlags.e_FlagUseHLR = 0x0080,
  DWG2PDFExportFlags.e_FlagFlateCompression = 0x0100, DWG2PDFExportFlags.e_FlagASCIIHexEncoding = 0x0200, DWG2PDFExportFlags.e_FlagExportHyperlinks = 0x0400, DWG2PDFExportFlags.e_FlagZoomToExtentsMode = 0x0800,
  DWG2PDFExportFlags.e_FlagLinearized = 0x1000, DWG2PDFExportFlags.e_FlagMeasuring = 0x4000
}
 Enumeration for flags of DWG to PDF export. More...
 
enum  DWG2PDFExportHatchesType { DWG2PDFExportHatchesType.e_DWG2PDFExportHatchesTypeBitmap = 0, DWG2PDFExportHatchesType.e_DWG2PDFExportHatchesTypeDrawing = 1, DWG2PDFExportHatchesType.e_DWG2PDFExportHatchesTypePdfPaths = 2, DWG2PDFExportHatchesType.e_DWG2PDFExportHatchesTypePolygons = 3 }
 Enumeration for hatches export type used for converting DWG to PDF. More...
 
enum  DWG2PDFLayoutScope {
  DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeModelSpaceOnly = 0, DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeCurrentLayout = 1, DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeAllLayouts = 2, DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeModelSpaceAndLayouts = 3,
  DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeFrameBlocks = 4, DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeDrawingLimits = 5, DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeAutoByLayoutOverflow = 6, DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeAutoRects = 7,
  DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeLayoutByIndex = 8, DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeAutoRectsAndAllLayouts = 9
}
 Enumeration for layout scope used for converting DWG to PDF. More...
 
enum  DWG2PDFLineweightStyleMode { DWG2PDFLineweightStyleMode.e_DWG2PDFLineweightStyleModeNoStyleNoLineweight = 0, DWG2PDFLineweightStyleMode.e_DWG2PDFLineweightStyleModeStyleAndLineweight = 1, DWG2PDFLineweightStyleMode.e_DWG2PDFLineweightStyleModeStyleNoLineweight = 2 }
 Enumeration for lineweight/style mode used for converting DWG to PDF. More...
 
enum  DWG2PDFSearchableTextType { DWG2PDFSearchableTextType.e_DWG2PDFSearchableTextTypeNoSearch = 0, DWG2PDFSearchableTextType.e_DWG2PDFSearchableTextTypeSHX = 1, DWG2PDFSearchableTextType.e_DWG2PDFSearchableTextTypeTTF = 2 }
 Enumeration for searchable text type used for converting DWG to PDF. More...
 

Public Member Functions

 DWG2PDFSettingData ()
 Constructor, with parameters.
 

Properties

int background_color_index [get, set]
 Background color index in the CAD color palette (range: [0-255]). More...
 
int color_image_output_dpi [get, set]
 Color image output DPI setting. More...
 
DWG2PDFSettingData.DWG2PDFColorPolicy color_policy [get, set]
 The color policy used for the converted PDF document. More...
 
string drawing_size_block_reference_name [get, set]
 The Name of the block reference used to compute drawing scale. More...
 
bool enable_diagnostic_log_output [get, set]
 Whether to output DWG2PDF diagnostic logs. More...
 
int export_flags [get, set]
 The export flags used for the converted PDF document. Please refer to values starting from foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFExportFlags.e_FlagEmbededTTF and this can be one or a combination of these values It could also be 0, which means all bits in the flag are 0. More...
 
DWG2PDFSettingData.DWG2PDFExportHatchesType export_hatches_type [get, set]
 The type of solid hatches export. More...
 
string frame_block_configuration_path [get, set]
 Frame block configuration XML path for frame-block export mode. More...
 
int geometry_output_dpi [get, set]
 Geometry output DPI setting. More...
 
DWG2PDFSettingData.DWG2PDFExportHatchesType gradient_export_hatches_type [get, set]
 The type of gradient hatches export. More...
 
bool is_active_layout [get, set]
 true means to export the active layout only, while false means not. Default value: false. More...
 
bool is_output_progress [get, set]
 A boolean value which indicates whether to output progress logs. true means to output progress logs, and false means not. Default value: true.
 
int layout_index [get, set]
 Layout index used when DWG2PDFSettingData::layout_scope is foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeLayoutByIndex . More...
 
DWG2PDFSettingData.DWG2PDFLayoutScope layout_scope [get, set]
 Layout export scope. More...
 
double lineweight_scale_factor [get, set]
 Lineweight scale factor. More...
 
DWG2PDFSettingData.DWG2PDFLineweightStyleMode lineweight_style_mode [get, set]
 Plot lineweight style mode. More...
 
double maximum_drawing_area [get, set]
 Maximum allowed drawing frame area (unit is millimeters). More...
 
double minimum_export_rect_side_length [get, set]
 Minimum drawing frame side length used by auto-rectangle export (unit is millimeters). More...
 
int monochrome_image_output_dpi [get, set]
 Monochrome image output DPI setting. More...
 
DWG2PDFSettingData.DWG2PDFExportHatchesType other_export_hatches_type [get, set]
 The type of other (non-solid) hatches export. More...
 
string output_author [get, set]
 The author for the output PDF document, an empty string will be used as default.
 
string output_creator [get, set]
 The creator for the output PDF document, an empty string will be used as default.
 
string output_keywords [get, set]
 The keywords for the output PDF document, an empty string will be used as default.
 
string output_producer [get, set]
 The producer for the output PDF document, an empty string will be used as default.
 
string output_subject [get, set]
 The subject for the output PDF document, an empty string will be used as default.
 
string output_title [get, set]
 The title for the output PDF document, an empty string will be used as default.
 
int page_margin [get, set]
 Page margin (unit is millimeters). More...
 
float paper_height [get, set]
 The paper height used for the converted PDF document. More...
 
float paper_width [get, set]
 The paper width used for the converted PDF document. More...
 
double plot_scale_factor [get, set]
 Plot scale factor. More...
 
global::System.IntPtr progress_callback [get, set]
 A pointer to a DWG2PDFProgressCallback object which is used to receive the progress of converting DWG to PDF. This parameter can be null.
 
DWG2PDFSettingData.DWG2PDFSearchableTextType searchable_text_type [get, set]
 The type of search text type. More...
 
bool treat_inches_as_millimeters [get, set]
 Whether to treat inch-based dimensions as millimeters. More...
 

Detailed Description

This class represents settings used for converting DWG to PDF. This would be used in class Convert .

See also
Convert

Member Enumeration Documentation

◆ DWG2PDFColorPolicy

Enumeration for color policy used for converting DWG to PDF.

Values of this enumeration should be used alone.

Enumerator
e_DWG2PDFColorPolicyNoPolicy 

Color policy: No color policy. A drawing is exported with its native color palette (as is).

e_DWG2PDFColorPolicyMono 

Color policy: Drawing is exported to a monochrome PDF file.

e_DWG2PDFColorPolicyGrayscale 

Color policy: Drawing is exported to a grayscale PDF file. Native colors are converted into grayscale.

e_DWG2PDFColorPolicyIndexToBlack 

Color policy: Index colors are converted to black, while all other colors keep their object colors.

◆ DWG2PDFExportFlags

Enumeration for flags of DWG to PDF export.

Values of this enumeration could be used alone or in a combination.

Enumerator
e_FlagEmbededTTF 

Bit 1. Enable embedding of TTF(True Type Font) program to PDF file. The whole TTF font file will be embedded (huge PDF size).

e_FlagTTFTextAsGeometry 

Bit 2. Enable TTF font text to geometry conversion.

e_FlagSHXTextAsGeometry 

Bit 3. Enable SHX font text to geometry conversion.

e_FlagSimpleGeomOptimization 

Bit 4. Enable simple geometry optimization (separated segments to one polyline, Bezier curve control points).

e_FlagEnableLayers 

Bit 5. If enabled, layer support will be added to PDF file (1.5 version required).

e_FlagIncludeOffLayers 

Bit 6. If enabled, invisible layers will be added to PDF file (1.5 version required).

e_FlagEmbededOptimizedTTF 

Bit 7. Enable embedding of TTF font program to PDF file. The TTF font will be reduced by removing unused parts (smaller PDF file size, but limited editing).

e_FlagUseHLR 

Bit 8. Determines whether software uses vector hidden-line removal for corresponding viewports.

e_FlagFlateCompression 

Bit 9. Enable compression of internal PDF streams.

e_FlagASCIIHexEncoding 

Bit 10. Enable ASCIIHex encoding of internal PDF streams.

e_FlagExportHyperlinks 

Bit 11. Enable hyperlinks export.

e_FlagZoomToExtentsMode 

Bit 12. If enabled, layout geometry will be zoomed to paper size, else layout settings will be applied.

Note
This mode works like some Layout settings: "Plot Area" - "Extents", "Fit to Paper", "Center the plot", these settings applied to specified paper size and orientation, but some settings like "Plot lineweight", "Plot style" are still applying from Layout settings.
e_FlagLinearized 

Bit 13. Create linearized PDF file.

e_FlagMeasuring 

Bit 15. Enable measuring scale in pdf.

◆ DWG2PDFExportHatchesType

Enumeration for hatches export type used for converting DWG to PDF.

Values of this enumeration should be used alone.

Enumerator
e_DWG2PDFExportHatchesTypeBitmap 

Hatches export type: Exports hatch as a bitmap.

e_DWG2PDFExportHatchesTypeDrawing 

Hatches export type: Exports hatch as a set of triangles (vectorizer).

e_DWG2PDFExportHatchesTypePdfPaths 

Hatches export type: Exports hatch as a PDF path (solid hatches only).

e_DWG2PDFExportHatchesTypePolygons 

Hatches export type: Exports hatch as a polygon (solid hatches only).

◆ DWG2PDFLayoutScope

Enumeration for layout scope used for converting DWG to PDF.

Values of this enumeration should be used alone.

Enumerator
e_DWG2PDFLayoutScopeModelSpaceOnly 

Export model space only.

e_DWG2PDFLayoutScopeCurrentLayout 

Export current layout.

e_DWG2PDFLayoutScopeAllLayouts 

Export all layouts.

e_DWG2PDFLayoutScopeModelSpaceAndLayouts 

Export model space and all valid layouts.

e_DWG2PDFLayoutScopeFrameBlocks 

Export configured frame blocks in model space as multiple PDF pages.

Note
Set DWG2PDFSettingData::frame_block_configuration_path to an XML configuration file path. Export order is from top-left to bottom- right. If frame blocks are exploded or no block names are configured, the whole model space is exported.
e_DWG2PDFLayoutScopeDrawingLimits 

Export drawing limits.

e_DWG2PDFLayoutScopeAutoByLayoutOverflow 

Auto-select layouts or model space based on viewport overflow check.

e_DWG2PDFLayoutScopeAutoRects 

Auto-detect and export multiple rectangles in model space.

e_DWG2PDFLayoutScopeLayoutByIndex 

Export a specific layout by index, specified by DWG2PDFSettingData::layout_index.

e_DWG2PDFLayoutScopeAutoRectsAndAllLayouts 

Merge results of foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeAutoRects and foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeAllLayouts into one PDF.

◆ DWG2PDFLineweightStyleMode

Enumeration for lineweight/style mode used for converting DWG to PDF.

Values of this enumeration should be used alone.

Enumerator
e_DWG2PDFLineweightStyleModeNoStyleNoLineweight 

Ignore plot style and lineweight.

e_DWG2PDFLineweightStyleModeStyleAndLineweight 

Enable plot style and lineweight.

e_DWG2PDFLineweightStyleModeStyleNoLineweight 

Enable plot style and ignore lineweight.

◆ DWG2PDFSearchableTextType

Enumeration for searchable text type used for converting DWG to PDF.

Values of this enumeration should be used alone.

Enumerator
e_DWG2PDFSearchableTextTypeNoSearch 

Searchable text type: No searchable text.

e_DWG2PDFSearchableTextTypeSHX 

Searchable text type: Only text displayed with SHX font is searchable.

e_DWG2PDFSearchableTextTypeTTF 

Searchable text type: Only text displayed with TTF font is searchable.

Property Documentation

◆ background_color_index

int foxit.addon.conversion.DWG2PDFSettingData.background_color_index
getset

Background color index in the CAD color palette (range: [0-255]).

Default value: 7. Common indices: 0-black, 1-red, 2-yellow, 3-green, 4-aqua, 5-blue, 6-magenta, 7-white, 8-dark gray. Other values follow the standard CAD color palette definitions. Values outside the range [0-255] are normalized to 7.

◆ color_image_output_dpi

int foxit.addon.conversion.DWG2PDFSettingData.color_image_output_dpi
getset

Color image output DPI setting.

Default value: 400. Valid values are 72, 150, 200, 300, 400, 600 and 1200. Values outside this set are normalized to 400.

◆ color_policy

DWG2PDFSettingData.DWG2PDFColorPolicy foxit.addon.conversion.DWG2PDFSettingData.color_policy
getset

The color policy used for the converted PDF document.

It use foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFColorPolicy.e_DWG2PDFColorPolicyNoPolicy as the default value of this option. Please refer to values starting from foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFColorPolicy.e_DWG2PDFColorPolicyNoPolicy and this should be one of these values.

◆ drawing_size_block_reference_name

string foxit.addon.conversion.DWG2PDFSettingData.drawing_size_block_reference_name
getset

The Name of the block reference used to compute drawing scale.

This option is effective only when DWG2PDFSettingData::layout_scope is foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeAutoRects . The block is treated as the drawing frame, and its original size is used to determine a scale factor applied during PDF export. If the specified block does not exist, this option will not take effect.

◆ enable_diagnostic_log_output

bool foxit.addon.conversion.DWG2PDFSettingData.enable_diagnostic_log_output
getset

Whether to output DWG2PDF diagnostic logs.

Default value is false. false means disabled, and true means enabled.

◆ export_flags

int foxit.addon.conversion.DWG2PDFSettingData.export_flags
getset

The export flags used for the converted PDF document. Please refer to values starting from foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFExportFlags.e_FlagEmbededTTF and this can be one or a combination of these values It could also be 0, which means all bits in the flag are 0.

It use foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFExportFlags.e_FlagEmbededTTF as the default value of this option.

◆ export_hatches_type

DWG2PDFSettingData.DWG2PDFExportHatchesType foxit.addon.conversion.DWG2PDFSettingData.export_hatches_type
getset

The type of solid hatches export.

It use foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFExportHatchesType.e_DWG2PDFExportHatchesTypeBitmap as the default value of this option. Please refer to values starting from foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFExportHatchesType.e_DWG2PDFExportHatchesTypeBitmap and this should be one of these values.

◆ frame_block_configuration_path

string foxit.addon.conversion.DWG2PDFSettingData.frame_block_configuration_path
getset

Frame block configuration XML path for frame-block export mode.

This file should contain configured title block names in format:

         <?xml version="1.0" encoding="utf-8" ?>
         <root>
         <TitleBlock name="Frame1">
         <TitleBlock name="Frame2">
         </root>
         

This option is mainly used when DWG2PDFSettingData::layout_scope is foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeFrameBlocks . The XML file name is not restricted. Empty string means no external frame-block configuration file is used.

◆ geometry_output_dpi

int foxit.addon.conversion.DWG2PDFSettingData.geometry_output_dpi
getset

Geometry output DPI setting.

Default value: 400. Valid values are 72, 150, 200, 300, 400, 600 and 1200. Values outside this set are normalized to 400.

◆ gradient_export_hatches_type

◆ is_active_layout

bool foxit.addon.conversion.DWG2PDFSettingData.is_active_layout
getset

true means to export the active layout only, while false means not. Default value: false.

Deprecated:
This property has been deprecated. Please use DWG2PDFSettingData::layout_scope instead. Setting DWG2PDFSettingData::layout_scope to foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeCurrentLayout provides the same behavior as setting current property to true.

◆ layout_index

int foxit.addon.conversion.DWG2PDFSettingData.layout_index
getset

Layout index used when DWG2PDFSettingData::layout_scope is foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeLayoutByIndex .

The Default value is 1 (the first layout). Values less than 1 are normalized to 1 when using layout by index mode. This option is ignored for other layout scope modes.

◆ layout_scope

◆ lineweight_scale_factor

double foxit.addon.conversion.DWG2PDFSettingData.lineweight_scale_factor
getset

Lineweight scale factor.

Default value: 1.0. This option is effective only when DWG2PDFSettingData::lineweight_style_mode is foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFLineweightStyleMode.e_DWG2PDFLineweightStyleModeStyleAndLineweight . Values less than or equal to 0 are treated as 1.0.

◆ lineweight_style_mode

DWG2PDFSettingData.DWG2PDFLineweightStyleMode foxit.addon.conversion.DWG2PDFSettingData.lineweight_style_mode
getset

◆ maximum_drawing_area

double foxit.addon.conversion.DWG2PDFSettingData.maximum_drawing_area
getset

Maximum allowed drawing frame area (unit is millimeters).

Default value is 0. This option is effective only when DWG2PDFSettingData::layout_scope is foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeAutoRects or foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeAutoRectsAndAllLayouts . If a drawing frame's area exceeds this value, it will be scaled down to fit within the limit. A value of 0 means no limit. Negative values will be treated as 0.

◆ minimum_export_rect_side_length

double foxit.addon.conversion.DWG2PDFSettingData.minimum_export_rect_side_length
getset

Minimum drawing frame side length used by auto-rectangle export (unit is millimeters).

Default value is 0. This option is effective only when DWG2PDFSettingData::layout_scope is foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeAutoRects . In this mode, any drawing frame whose width or height is smaller than this value will be skipped. If this value exceeds the maximum side length of all detected drawing frames, all frames will be skipped. A value of 0 means no limit. Negative values will be treated as 0.

◆ monochrome_image_output_dpi

int foxit.addon.conversion.DWG2PDFSettingData.monochrome_image_output_dpi
getset

Monochrome image output DPI setting.

Default value: 400. Valid values are 72, 150, 200, 300, 400, 600 and 1200. Values outside this set are normalized to 400.

◆ other_export_hatches_type

◆ page_margin

int foxit.addon.conversion.DWG2PDFSettingData.page_margin
getset

Page margin (unit is millimeters).

Default value: 0. Negative values are treated as 0. Values exceeding half of the page size will be set to less than half of the page size.

◆ paper_height

float foxit.addon.conversion.DWG2PDFSettingData.paper_height
getset

The paper height used for the converted PDF document.

This option can be used if layout geometry will be zoomed to paper size(foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFExportFlags.e_FlagZoomToExtentsMode are enabled by export_flags). Effective default value is 297.0f. Unit: millimeters. If this value is less than or equal to 0, it is normalized to 297.0f.

◆ paper_width

float foxit.addon.conversion.DWG2PDFSettingData.paper_width
getset

The paper width used for the converted PDF document.

This option can be used if layout geometry will be zoomed to paper size(foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFExportFlags.e_FlagZoomToExtentsMode are enabled by export_flags). Effective default value is 420.0f. Unit: millimeters. If this value is less than or equal to 0, it is normalized to 420.0f.

◆ plot_scale_factor

double foxit.addon.conversion.DWG2PDFSettingData.plot_scale_factor
getset

Plot scale factor.

Default value is 0.99. No strict upper bound is enforced for this value. However, invalid inputs are normalized to maintain stable output. Values less than 0 are normalized to 0.1, and 0 is normalized to 0.99.

◆ searchable_text_type

DWG2PDFSettingData.DWG2PDFSearchableTextType foxit.addon.conversion.DWG2PDFSettingData.searchable_text_type
getset

◆ treat_inches_as_millimeters

bool foxit.addon.conversion.DWG2PDFSettingData.treat_inches_as_millimeters
getset

Whether to treat inch-based dimensions as millimeters.

Default value is false. This option is effective only when the drawing uses inches as its unit and DWG2PDFSettingData::layout_scope is foxit.addon.conversion.DWG2PDFSettingData.DWG2PDFLayoutScope.e_DWG2PDFLayoutScopeAutoRects . false means disabled, and true means enabled.