Convert CGM Image to PDF

Convert CGM Image to PDF

Computer Graphics Metafile (CGM) is a free and open international standard file format for 2D vector graphics, raster graphics, and text defined by ISO/IEC 8632. Aspose.PDF for .NET supports converting CGM files into PDF.

Supported CGM Commands

Please look at the list of CGM commands specified below and their level of support in Aspose.PDF for .NET Legend:
+ : supported
- : unsupported
! : partially supported

Delimiter Elements: Class 0

ClassElement CodeElement NameStatusComment
00NO OP+ 
01BEGIN METAFILE+ 
02END METAFILE+ 
03BEGIN PICTURE+ 
04BEGIN PICTURE BODY+ 
05END PICTURE+ 
06BEGIN SEGMENT+ 
07END SEGMENT+ 
08BEGIN FIGURE+ 
09END FIGURE+ 
013BEGIN PROTECTION REGION- 
014END PROTECTION REGION- 
015BEGIN COMPOUND LINE- 
016END COMPOUND LINE- 
017BEGIN COMPOUND TEXT PATH- 
018END COMPOUND TEXT PATH- 
019BEGIN TILE ARRAY- 
020END TILE ARRAY- 
021BEGIN APPLICATION STRUCTURE- 
022BEGIN APPLICATION STRUCTURE BODY- 
023END APPLICATION STRUCTURE- 

Metafile Descriptor Elements: Class 1

ClassElement CodeElement NameStatusComment
11METAFILE VERSION+ 
12METAFILE DESCRIPTION+ 
13VDC TYPE+ 
14INTEGER PRECISION+ 
15REAL PRECISION+ 
16INDEX PRECISION+ 
17COLOUR PRECISION+ 
18COLOUR INDEX PRECISION+ 
19MAXIMUM COLOUR INDEX+ 
110COLOUR VALUE EXTENT+ 
111METAFILE ELEMENT LIST- 
112METAFILE DEFAULTS REPLACEMENT+ 
113FONT LIST+ 
114CHARACTER SET LIST- 
115CHARACTER CODING ANNOUNCER- 
116NAME PRECISION+ 
117MAXIMUM VDC EXTENT+ 
118SEGMENT PRIORITY EXTENT- 
119COLOUR MODEL!Color spaces other than RGB and CMYK are not implemented.
120COLOUR CALIBRATION- 
121FONT PROPERTIES- 
122GLYPH MAPPING- 
123SYMBOL LIBRARY LIST- 
124PICTURE DIRECTORY- 

Picture Descriptor Elements: Class 2

ClassElement CodeElement NameStatusComment
21SCALING MODE+ 
22COLOUR SELECTION MODE+ 
23LINE WIDTH SPECIFICATION MODE+ 
24MARKER SIZE SPECIFICATION MODE+ 
25EDGE WIDTH SPECIFICATION MODE+ 
26VDC EXTENT+ 
27BACKGROUND COLOUR+ 
28DEVICE VIEWPORT- 
29DEVICE VIEWPORT SPECIFICATION MODE- 
210DEVICE VIEWPORT MAPPING- 
211LINE REPRESENTATION- 
212MARKER REPRESENTATION- 
213TEXT REPRESENTATION- 
214FILL REPRESENTATION- 
215EDGE REPRESENTATION- 
216INTERIOR STYLE SPECIFICATION MODE- 
217LINE AND EDGE TYPE DEFINITION+ 
218HATCH STYLE DEFINITION- 
219GEOMETRIC PATTERN DEFINITION- 
220APPLICATION STRUCTURE DIRECTORY- 

Control Elements: Class 3

ClassElement CodeElement NameStatusComment
31VDC INTEGER PRECISION+ 
32VDC REAL PRECISION+ 
33AUXILIARY COLOUR- 
34TRANSPARENCY- 
35CLIP RECTANGLE+ 
36CLIP INDICATOR- 
37LINE CLIPPING MODE- 
38MARKER CLIPPING MODE- 
39EDGE CLIPPING MODE- 
310NEW REGION- 
311SAVE PRIMITIVE CONTEXT- 
312RESTORE PRIMITIVE CONTEXT- 
317PROTECTION REGION INDICATOR- 
318GENERALIZED TEXT PATH MODE- 
319MITRE LIMIT+ 
320TRANSPARENT CELL COLOUR- 

Graphical Primitive Elements: Class 4

ClassElement CodeElement NameStatusComment
41POLYLINE+ 
42DISJOINT POLYLINE+ 
43POLYMARKER+ 
44TEXT+ 
45RESTRICTED TEXT+ 
46APPEND TEXT+ 
47POLYGON+ 
48POLYGON SET+ 
49CELL ARRAY+ 
410GENERALIZED DRAWING PRIMITIVE+ 
411RECTANGLE+ 
412CIRCLE+ 
413CIRCULAR ARC 3 POINT+ 
414CIRCULAR ARC 3 POINT CLOSE+ 
415CIRCULAR ARC CENTRE+ 
416CIRCULAR ARC CENTRE CLOSE+ 
417ELLIPSE+ 
418ELLIPTICAL ARC+ 
419ELLIPTICAL ARC CLOSE+ 
420CIRCULAR ARC CENTRE REVERSED- 
421CONNECTING EDGE+ 
422HYPERBOLIC ARC- 
423PARABOLIC ARC- 
424NON UNIFORM B SPLINE- 
425NON UNIFORM RATIONAL B SPLINE- 
426POLYBEZIER+ 
427POLYSYMBOL- 
428BITONAL TILE- 
429TILE- 

Attribute Elements: Class 5

ClassElement CodeElement NameStatusComment
51LINE BUNDLE INDEX+ 
52LINE TYPE+ 
53LINE WIDTH+ 
54LINE COLOUR+Color spaces other than RGB and CMYK are not implemented.
55MARKER BUNDLE INDEX+ 
56MARKER TYPE+ 
57MARKER SIZE+ 
58MARKER COLOUR+Color spaces other than RGB and CMYK are not implemented.
59TEXT BUNDLE INDEX+ 
510TEXT FONT INDEX+ 
511TEXT PRECISION+ 
512CHARACTER EXPANSION FACTOR+ 
513CHARACTER SPACING+ 
514TEXT COLOUR+Color spaces other than RGB and CMYK are not implemented.
515CHARACTER HEIGHT+ 
516CHARACTER ORIENTATION+ 
517TEXT PATH+ 
518TEXT ALIGNMENT+ 
519CHARACTER SET INDEX- 
520ALTERNATE CHARACTER SET INDEX- 
521FILL BUNDLE INDEX+ 
522INTERIOR STYLE+ 
523FILL COLOUR+Color spaces other than RGB and CMYK are not implemented.
524HATCH INDEX+ 
525PATTERN INDEX+ 
526EDGE BUNDLE INDEX+ 
527EDGE TYPE+ 
528EDGE WIDTH+ 
529EDGE COLOUR+ 
530EDGE VISIBILITY+ 
531FILL REFERENCE POINT+ 
532PATTERN TABLE+ 
533PATTERN SIZE+ 
534COLOUR TABLE+ 
535ASPECT SOURCE FLAGS!Only color values
536PICK IDENTIFIER- 
537LINE CAP+ 
538LINE JOIN+ 
539LINE TYPE CONTINUATION- 
540LINE TYPE INITIAL OFFSET- 
541TEXT SCORE TYPE- 
542RESTRICTED TEXT TYPE- 
543INTERPOLATED INTERIOR- 
544EDGE CAP+ 
545EDGE JOIN+ 
546EDGE TYPE CONTINUATION- 
547EDGE TYPE INITIAL OFFSET- 
548SYMBOL LIBRARY INDEX- 
549SYMBOL COLOUR- 
550SYMBOL SIZE- 
551SYMBOL ORIENTATION- 

Escape Elements: Class 6

ClassElement CodeElement NameStatusComment
61ESCAPE- 

External Elements: Class 7

ClassElement CodeElement NameStatusComment
71MESSAGE- 
72APPLICATION DATA- 

Segment Elements: Class 8

ClassElement CodeElement NameStatusComment
81COPY SEGMENT+ 
82INHERITANCE FILTER- 
83CLIP INHERITANCE- 
84SEGMENT TRANSFORMATION+ 
85SEGMENT HIGHLIGHTING- 
86SEGMENT DISPLAY PRIORITY+ 
87SEGMENT PICK PRIORITY- 

Application Structure Descriptor Elements: Class 9

ClassElement CodeElement NameStatusComment
91APPLICATION STRUCTURE ATTRIBUTE- 
Aspose has always been committed to provide robust, easy to use and scalable products and keeping this tradition alive, converting CGM PDF is very easy. The PdfProducer class under Aspose.PDF.Facades) namespace provides a method named Producer which can be used to convert CGM files into PDF. Please take a look over following code snippet which shows the conversion of CGM file into PDF.

Some CGM files have very large size (width x height) and there are situations when you need to load the CGM file with a specific size and convert it to PDF. In order to accomplish this requirement, use the CgmImportOptions in the Aspose.PDF namespace which provides the feature to load CGM files with a custom size. Please note that one of the overloaded methods of the Producer class accepts CgmImportOptions as an argument. The following code snippet explains this behavior.

Known Issues

Images are often used to clarify or illustrate data and are often shared between colleagues. Sharing images in PDF format is a convenient way to ensure that everyone can view them. To this end, Aspose.PDF for .NET supports converting images to PDF. The following table shows the image formats that Aspose.PDF can convert to PDF.

Image File TypesDescription
CCITTCCITT is a lossless image compression method used in Group 4 fax machines. It is used for black and white images only.
GIFGraphics Interchange Format, a bitmap image format frequently used on the web, uses a lossless compression.
JPEGJoint Photographic Experts Group is a lossy compression method for digital images, developed for use with digital photography.
PNGPortable Network Graphics is an improved, non-patented replacement for GIF and is a popular lossless image compression format used on the web.
TIFFTagged Image File Format is a file format for storing raster graphics. It is widely used in word processing and digital image manipulation applications.
BMPThe bitmap file format is a raster graphics image format used to store digital images. It is created to be device independent.
EMFEnhanced Meta File is a 32-bit version of Microsoft’s Windows Meta File format.
ExifExchangeable Image File format specifies formats for images, sound and other tags used by digital cameras, smartphones and other devices.
IconICO files are files that hold icons – pictograms representing actions, for example – for computer interfaces.
WMFWindows Meta File is a device independent image format aimed to take both vector and raster graphics.
MemoryBmpMemoryBmp type
UnknownUnknown file type.