combit List & Label 30 - .NET Help
combit.Reporting Namespace / PreviewFile Class / ConvertTo Method / ConvertTo(String,String) Method

Name of the target file. It is also possible to use the placeholder "%d" (e.g. "page %d"). This is important, for example, for export formats that would create several files per page, such as JPEG conversion, as otherwise only a single page would be created.

Target format. Valid values are:

This parameter allows you to declare a semicolon-separated list with further export options. You will find the accepted values in the chapter for the export modules in the Programmer's Manual. Please note that not all options can be supported with this API. An example is the parameter "PDF;PDF.EncryptionFile=1".


Additional to the mentioned parameters above the following parameters can be used:

Value Meaning
PageIndexRange Analog to the print options dialog a range for pages can be set.
JobIndexRange Analog to the print options dialog a range for the job can be set.
IssueIndexRange Analog to the print options dialog a range for the issues can be set.

An example of this is the use of " PDF;Export.PageIndexRange=2-3". With this, only pages 2 and 3 are converted to PDF.

The export to "PRN" creates a file that is specially prepared for the given printer (parameter "PRN.Device="). This file can be output on the printer by copying it directly. Therefore the printer name (device name) must be explicitly defined.



ConvertTo(String,String) Method
Converts the preview file into the given filename.  Allows to specify the format and additional options.
Syntax
'Declaration
 
Public Overloads Sub ConvertTo( _
   ByVal filename As String, _
   ByVal targetFormat As String _
) 
 

Parameters

filename

Name of the target file. It is also possible to use the placeholder "%d" (e.g. "page %d"). This is important, for example, for export formats that would create several files per page, such as JPEG conversion, as otherwise only a single page would be created.

targetFormat

Target format. Valid values are:

  • "TIFF" (also "PICTURE_MULTITIFF")
  • "JPEG" (also "PICTURE_JPEG")
  • "PNG" (also "PICTURE_PNG")
  • "EMF"
  • "TTY"
  • "PDF"
  • "PRN"
  • "XPS"
  • "TXT"
  • "LL" (also "PRV")       

This parameter allows you to declare a semicolon-separated list with further export options. You will find the accepted values in the chapter for the export modules in the Programmer's Manual. Please note that not all options can be supported with this API. An example is the parameter "PDF;PDF.EncryptionFile=1".


Additional to the mentioned parameters above the following parameters can be used:

Value Meaning
PageIndexRange Analog to the print options dialog a range for pages can be set.
JobIndexRange Analog to the print options dialog a range for the job can be set.
IssueIndexRange Analog to the print options dialog a range for the issues can be set.

An example of this is the use of " PDF;Export.PageIndexRange=2-3". With this, only pages 2 and 3 are converted to PDF.

The export to "PRN" creates a file that is specially prepared for the given printer (parameter "PRN.Device="). This file can be output on the printer by copying it directly. Therefore the printer name (device name) must be explicitly defined.

Remarks

Additional formats can be converted from the preview file if they were previously embedded in the preview file using the LlOptionString.EmbeddedExportFormats option. The blog article Export Files Directly From the Preview describes the procedure in detail. These formats are then also available during the conversion:

  • "XHMTL"
  • "MHTML"
  • "DOCX"
  • "XLS"
Example

An example of this is the use of "PDF;Export.PageIndexRange=2-3". With this, only pages 2 and 3 are converted to PDF.

// Open existing preview file
PreviewFile previewFile = new PreviewFile(@"C:\preview.ll");

// Convert the preview file into PDF with the following options:
// - only pages 2-3
// - embed TrueType-Fonts
previewFile.ConvertTo(@"C:\preview.pdf","PDF;Export.PageIndexRange=2-3");

// Close and free preview file
previewFile.Close();
previewFile.Dispose();

 

Requirements

Platforms: Windows 10 (Version 21H2 - 23H2), Windows 11 (21H2 - 22H2), Windows Server 2016 - 2022
.NET: .NET Framework 4.8, .NET 6, .NET 8, .NET 9

See Also