Convert VISIO TO PDF

Download Developer API Guide

VisioToPdf Object Description

This object is used to convert Microsoft Visio to pdf. VisioToPdf only works with Microsoft Visio 2007 or higher version. Only Visio 2007 requires the free "Save as PDF or XPS" add-in for Office 2007 to be installed. This add-in is available from Microsoft.

// Create an Object
VisioToPdf visioToPdf = new VisioToPdf();
// Covert to Pdf
visioToPdf.convert("C:\\Users\\Desktop\\input.vsd", "C:\\Users\\Desktop\\output.pdf");


Properties


ConversionTimeOut Property

Set the file coversion time out property. Default is 5 min.

Type

Int (minute)

Usage

// Create an Object
VisioToPdf visioToPdf = new VisioToPdf();
// Set the ConversionTimeOut Properties
visioToPdf.setConversionTimeOut(1);
// Covert to Pdf
visioToPdf.convert("C:\\Users\\Desktop\\input.vsd", "C:\\Users\\Desktop\\output.pdf");

VisioPrintOutRange Property

This is used to define range of document pages to be exported, Default is set to PDFVisioPrintOutRange.VISIO_PRINT_ALL.

Type

PDFVisioPrintOutRange

VISIO_PRINT_ALL = 0 Prints all foreground pages.
VISIO_PRINT_FROM_TO = 1 Prints pages between the FromPage value and the ToPage value.
VISIO_PRINT_CURRENT_PAGE = 2 Prints the active page.
VISIO_PRINT_SELECTION = 3 Prints a selection.
VISIO_PRINT_CURRENT_VIEW = 4 Prints the current view area.

Usage

// Create an Object
VisioToPdf visioToPdf = new VisioToPdf();
// Set the VisioPrintOutRange Properties
visioToPdf.setVisioPrintOutRange(PDFVisioPrintOutRange.VISIO_PRINT_CURRENT_PAGE);
// Covert to Pdf
visioToPdf.convert("C:\\Users\\Desktop\\input.vsd", "C:\\Users\\Desktop\\output.pdf");

ColorAsBlack Property

True to render all colors as black to ensure that all shapes are visible in the exported drawing. False to render colors normally. The default is False .

Type

Boolean

Usage

// Create an Object
VisioToPdf visioToPdf = new VisioToPdf();
// Set the ColorAsBlack Properties
visioToPdf.setColorAsBlack(true);
// Covert to Pdf
visioToPdf.convert("C:\\Users\\Desktop\\input.vsd", "C:\\Users\\Desktop\\output.pdf");

IncludeBackground Property

Whether to include background pages in the exported file. The default is True .

Type

Boolean

Usage

// Create an Object
VisioToPdf visioToPdf = new VisioToPdf();
// Set the IncludeBackground Properties
visioToPdf.setIncludeBackground(false);
// Covert to Pdf
visioToPdf.convert("C:\\Users\\Desktop\\input.vsd", "C:\\Users\\Desktop\\output.pdf");

IncludeDocumentProperties Property

Whether to include document properties in the exported file. The default is True .

Type

Boolean

Usage

// Create an Object
VisioToPdf visioToPdf = new VisioToPdf();
// Set the IncludeDocumentProperties Properties
visioToPdf.setIncludeStructureTags(false);
// Covert to Pdf
visioToPdf.convert("C:\\Users\\Desktop\\input.vsd", "C:\\Users\\Desktop\\output.pdf");

IncludeStructureTags Property

Whether to include document structure tags to improve document accessibility. The default is True .

Type

Boolean

Usage

// Create an Object
VisioToPdf visioToPdf = new VisioToPdf();
// Set the IncludeStructureTags Properties
visioToPdf.setIncludeStructureTags(false);
// Covert to Pdf
visioToPdf.convert("C:\\Users\\Desktop\\input.vsd", "C:\\Users\\Desktop\\output.pdf");

NativeOfficePDF Property

Whether the resulting document is compliant with ISO 19005-1 (PDF/A). The default is False .

Type

Boolean

Usage

// Create an Object
VisioToPdf visioToPdf = new VisioToPdf();
// Set the NativeOfficePDF Properties
visioToPdf.setNativeOfficePDF(false);
// Covert to Pdf
visioToPdf.convert("C:\\Users\\Desktop\\input.vsd", "C:\\Users\\Desktop\\output.pdf");