How to convert and view CFF2 and CF2 files

Introduction

CF2 (also CF2, CFF2) is a Common File Format File of revision 2. This file format is designed for exchange of cardboard boxes (goods packaging) drawings. It contains text instructions splitted by sections for the numerical control machine (NC machine) tool.

View CF2 files

The CF2 can be opened with desktop applications like e.g. PicView 8.

In case you need to view a CF2 file in a browser or in a standard image or PDF viewer application, you can convert it to HTML, JPEG, PNG  PDF format with GroupDocs.Viewer for .NET. 

Convert CF2 to HTML

To convert CF2 files to HTML with GroupDocs.Viewer for .NET use following code:

using (Viewer viewer = new Viewer("sample.cf2"))
{
       HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources("output.html");
       //options.CadOptions = CadOptions.ForRenderingByScaleFactor(0.7f); // Render image and reduce it by 30%
       //options.CadOptions = CadOptions.ForRenderingByWidthAndHeight(400,400); // Render image and set output size to 400x400
       //options.CadOptions = CadOptions.ForRenderingByWidth(500); // Render image, fix width by 500 px and recalculate height
       //options.CadOptions = CadOptions.ForRenderingByHeight(500); // Render image, fix height by 500 px and recalculate width

       viewer.View(options);
}

The following screenshot shows the output HTML file opened in a browser.

Convert CF2 to JPG

To convert CF2 files to JPG with GroupDocs.Viewer for .NET use following code: 

using (Viewer viewer = new Viewer("sample.cf2"))
{
       JpgViewOptions options = new JpgViewOptions("output.jpg");
	   //options.CadOptions = CadOptions.ForRenderingByScaleFactor(0.7f); // Render image and reduce it by 30%
       //options.CadOptions = CadOptions.ForRenderingByWidthAndHeight(400,400); // Render image and set output size to 400x400
       //options.CadOptions = CadOptions.ForRenderingByWidth(500); // Render image, fix width by 500 px and recalculate height
       //options.CadOptions = CadOptions.ForRenderingByHeight(500); // Render image, fix height by 500 px and recalculate width

       viewer.View(options);
}

The following screenshot shows the output JPG file opened in a Windows Photo Viewer application.

Convert CF2 to PNG

To convert CF2 files to PNG with GroupDocs.Viewer for .NET use following code: 

using (Viewer viewer = new Viewer("sample.cf2"))
{
       PngViewOptions options = new PngViewOptions("output.png");
	   //options.CadOptions = CadOptions.ForRenderingByScaleFactor(0.7f); // Render image and reduce it by 30%
       //options.CadOptions = CadOptions.ForRenderingByWidthAndHeight(400,400); // Render image and set output size to 400x400
       //options.CadOptions = CadOptions.ForRenderingByWidth(500); // Render image, fix width by 500 px and recalculate height
       //options.CadOptions = CadOptions.ForRenderingByHeight(500); // Render image, fix height by 500 px and recalculate width

       viewer.View(options);
}

The following screenshot shows the output PNG file opened in a Windows Photo Viewer application.

Convert CF2 to PDF

To convert CF2 files to PDF with GroupDocs.Viewer for .NET use following code: 

using (Viewer viewer = new Viewer("sample.cf2"))
{
       PdfViewOptions options = new PdfViewOptions("output.pdf");
	   //options.CadOptions = CadOptions.ForRenderingByScaleFactor(0.7f); // Render image and reduce it by 30%
       //options.CadOptions = CadOptions.ForRenderingByWidthAndHeight(400,400); // Render image and set output size to 400x400
       //options.CadOptions = CadOptions.ForRenderingByWidth(500); // Render image, fix width by 500 px and recalculate height
       //options.CadOptions = CadOptions.ForRenderingByHeight(500); // Render image, fix height by 500 px and recalculate width

       viewer.View(options);
}

The following screenshot shows the output PDF file opened in a browser.

More resources

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App

Along with full-featured .NET library we provide simple but powerful free Apps. You are welcome to view Word, PDF, Excel, PowerPoint documents with free to use online GroupDocs Viewer App.