The ExportToTIFF method converts a PDF document to a Tiff document.
This method needs special license. Please, contact our Sales Department for more information
System.Boolean ExportToTIFF( System.String FileName, CDIntfEx.acTiffExportOptions TiffOption )
FileName
Full path of resulting TIFF file(s).
TiffOption
TIFF generation options. The Options value is a combination of the Image Resolution in the HIWORD and the TIFF Compression Level in LOWORD (Resolution << 16 | Compression).
Returns True if the document was converted, False otherwise.
These are the values to use for compression:
Compression Level
Value |
Compression Level |
---|---|
0 |
No Compression |
1 |
256 Colors with LZW compression |
2 – 9 |
JPEG Compression |
10 |
CCITT Compression |
Not all Tiff viewers support JPeg compressed Tiff files, TiffFormat 2 to 9 should be used only if the end-user’s viewer supports these formats.
Optimizing the document is not recommended when exporting to image formats, it slows down the export and the output might be less accurate.
When the PDF document consists of multiple pages, one TIFF file is generated for every page with the page index appended to the supplied file name.
See also DocConvertToTIFF or PDF2TIFF.
Member of CDIntfEx.Document.
<Flags()>
Public Enum OPTIMIZE As Integer
NO_OPTIMIZATION = 0
LINE_OPTIMIZATION = 1
PARAGRAPH_OPTIMIZATION = 2
TABLE_OPTIMIZATION = 3
End Enum
Private Sub Sample()
' Constants for Activation codes
Const strLicenseTo As String = "Amyuni PDF Converter Evaluation"
Const strActivationCode As String = "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA"
' Declare a new cdintfex document if it does not exist in the form.
Dim pdfDoc As New CDIntfEx.Document
' Open the document
pdfDoc.Open("c:\temp\test.pdf")
' The SetLicenseKey method should be called after creating an object of type
' CDIntfEx.Document to activate the advanced methods that require the object
' activation code to work properly
pdfDoc.SetLicenseKey(strLicenseTo, strActivationCode)
' Optimize the document in Paragraph level, this step can be ignored
pdfDoc.Optimize(OPTIMIZE.NO_OPTIMIZATION)
' Export to TIFF, but the license needs to have that option
Dim resolution as Integer = 300
Dim compression As Integer = 10
pdfDoc.ExportToTIFF("c:\temp\image.tiff", resolution << 16 Or compression)
End Sub
[Flags]
public enum OPTIMIZE
{
NO_OPTIMIZATION = 0,
LINE_OPTIMIZATION = 1,
PARAGRAPH_OPTIMIZATION = 2,
TABLE_OPTIMIZATION = 3
}
private void Sample()
{
// Constants for Activation codes
const string strLicenseTo = "Amyuni PDF Converter Evaluation";
const string strActivationCode = "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA";
// Declare a new cdintfex document if it does not exist in the form.
CDIntfEx.Document pdfDoc = new CDIntfEx.Document();
// Open the document
pdfDoc.Open("c:\\temp\\test.pdf");
// The SetLicenseKey method should be called after creating an object of type
// CDIntfEx.Document to activate the advanced methods that require the object
// activation code to work properly
pdfDoc.SetLicenseKey(strLicenseTo, strActivationCode);
// Optimize the document in Paragraph level, this step can be ignored
pdfDoc.Optimize((int) OPTIMIZE.NO_OPTIMIZATION);
// Export to TIFF, but the license needs to have that option
int resolution = 300;
int compression = 10;
pdfDoc.ExportToTIFF(@"c:\temp\image.tiff", (CDIntfEx.acTiffExportOptions)(resolution << 16 | compression));
}
package Example;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
public class Sample {
public enum OPTIMIZE
{
NO_OPTIMIZATION (0),
LINE_OPTIMIZATION (1),
PARAGRAPH_OPTIMIZATION (2),
TABLE_OPTIMIZATION (3);
private int value;
private OPTIMIZE(int value)
{
this.value = value;
}
public Object value(){
return value;
}
}
public static void main(String[] args)
{
// Constants for Activation codes
String strLicenseTo = "Amyuni PDF Converter Evaluation";
String strActivationCode = "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA";
// Declare a new cdintfex document if it does not exist in the form.
ActiveXComponent pdfDoc = new ActiveXComponent("CDIntfEx.Document.6.5");
// Open the document
Dispatch.call(pdfDoc, "Open", "c:\\temp\\test.pdf");
// The SetLicenseKey method should be called after creating an object of type
// CDIntfEx.Document to activate the advanced methods that require the object
// activation code to work properly
Dispatch.call(pdfDoc, "SetLicenseKey", strLicenseTo, strActivationCode);
// Optimize the document in Paragraph level, this step can be ignored
Dispatch.call(pdfDoc, "Optimize",OPTIMIZE.NO_OPTIMIZATION.value);
// Export to TIFF, but the license needs to have that option
int resolution = 300;
int compression = 10;
Dispatch.call(pdfDoc, "ExportToTIFF", "c:\\temp\\image.tiff", resolution << 16 | compression);
// Destroy pdfDoc object
pdfDoc = null;
}
}
$OPTIMIZE = @{
NO_OPTIMIZATION = 0
LINE_OPTIMIZATION = 1
PARAGRAPH_OPTIMIZATION = 2
TABLE_OPTIMIZATION = 3
}
# Constants for Activation codes
$strLicenseTo = "Amyuni PDF Converter Evaluation"
$strActivationCode = "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA"
# Declare a new cdintfex document if it does not exist in the form.
$pdfDoc = New-Object -ComObject CDIntfEx.Document.6.5
# Open the document
[System.__ComObject].InvokeMember('Open', [System.Reflection.BindingFlags]::InvokeMethod,$null,$pdfDoc,"c:\temp\test.pdf")
# The SetLicenseKey method should be called after creating an object of type
# CDIntfEx.Document to activate the advanced methods that require the object
# activation code to work properly
[System.__ComObject].InvokeMember('SetLicenseKey', [System.Reflection.BindingFlags]::InvokeMethod,$null,$pdfDoc, @($strLicenseTo, $strActivationCode))
# Optimize the document in Paragraph level, this step can be ignored
[System.__ComObject].InvokeMember('Optimize', [System.Reflection.BindingFlags]::InvokeMethod,$null,$pdfDoc, $OPTIMIZE::NO_OPTIMIZATION)
# Export to TIFF, but the license needs to have that option
$resolution = 300
$compression = 10
[System.__ComObject].InvokeMember('ExportToTIFF', [System.Reflection.BindingFlags]::InvokeMethod,$null,$pdfDoc,
@("c:\temp\image.tiff", (1 -shl 16)*$resolution -bOr $compression))
# Destroy pdfDoc object
$pdfDoc = $null
Const NO_OPTIMIZATION = 0
Const LINE_OPTIMIZATION = 1
Const PARAGRAPH_OPTIMIZATION = 2
Const TABLE_OPTIMIZATION = 3
Const acTiffExportOptionCCITTLow = 9830410
Const acTiffExportOptionCCITTMedium = 19660810
Const acTiffExportOptionCCITTHigh = 39321610
Const acTiffExportOptionDefault = 13107210
' Constants for Activation codes
Const strLicenseTo = "Amyuni PDF Converter Evaluation"
Const strActivationCode = "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA"
' Declare a new cdintfex document if it does not exist in the form.
Dim pdfDoc
Set pdfDoc = CreateObject("CDIntfEx.Document.6.5")
' Open the document
pdfDoc.Open "c:\temp\test.pdf"
' The SetLicenseKey method should be called after creating an object of type
' CDIntfEx.Document to activate the advanced methods that require the object
' activation code to work properly
pdfDoc.SetLicenseKey strLicenseTo, strActivationCode
' Optimize the document in Paragraph level, this step can be ignored
pdfDoc.Optimize NO_OPTIMIZATION
' Export to TIFF, but the license needs to have that option
Dim resolution
resolution = 300
Dim compression
compression = 10
pdfDoc.ExportToTIFF "c:\temp\image.tiff", 65536 * resolution Or compression
' Destroy pdfDoc object
Set pdfDoc = Nothing