126
© PDF Tools AG – Premium PDF Technology
3-Heights™ PDF to Image Converter API, March 24, 2016 | 2/67
5
User’s Guide ....................................................................... 21
5.1
Supported Codecs ................................................................... 21
5.1.1
File and Compression Type ........................................................ 22
5.2
How to Create Multi and Single-Page Images ............................................. 23
5.2.1
Multi-Page Images ............................................................... 23
5.2.2
Single-Page Images .............................................................. 23
5.3
How to Set Pixels Equal Points ......................................................... 23
5.4
How to Reduce the File Size ........................................................... 23
5.4.1
Dimensions .................................................................... 24
5.4.2
Resolution ..................................................................... 24
5.4.3
Bits per Pixel .................................................................... 24
5.4.4
Format/Compression Type ........................................................ 24
5.4.5
Image Content, Dithering ......................................................... 25
5.5
How to Use the In-Memory Methods .................................................... 26
5.5.1
Creating a Document in Memory ................................................... 26
5.5.2
Reading a Document from Memory ................................................. 26
5.6
Color Profiles ....................................................................... 27
5.6.1
Default Color Profiles ............................................................. 27
5.6.2
Set other Color Profiles ........................................................... 27
5.6.3
Get Other Color Profiles .......................................................... 27
5.7
Fonts ............................................................................. 28
5.7.1
Font Directories ................................................................. 28
5.7.2
Font Configuration File fonts.ini .................................................... 28
5.8
How to Change the Colors - Receive a Darker Black ........................................ 29
5.9
How to Apply Isomorphic Stretching .................................................... 30
5.10
Dithering .......................................................................... 30
5.10.1
Remarks ....................................................................... 30
5.10.2
Color Images ................................................................... 31
5.10.3
Bi-tonal Images ................................................................. 32
5.10.4
Guidelines ..................................................................... 34
6
Programmer’s Reference ............................................................ 35
6.1
PdfToImg
Interface ................................................................. 35
6.1.1
BilevelThreshold
........................................................... 35
6.1.2
BitmapHeight
................................................................ 35
6.1.3
BitmapWidth
................................................................. 35
6.1.4
BitsPerPixel
................................................................ 36
6.1.5
Center
....................................................................... 36
6.1.6
Close
........................................................................ 36
6.1.7
CloseImage
.................................................................. 36
6.1.8
ColorSpace
.................................................................. 37
6.1.9
Compression
................................................................. 37
6.1.10
ConvertFile
................................................................. 37
6.1.11
CreateImage
................................................................. 38
6.1.12
CreateImageInMemory
....................................................... 38
6.1.13
Dithering
................................................................... 39
6.1.14
DPI
.......................................................................... 39
6.1.15
ErrorCode
................................................................... 39
6.1.16
FaxHSetting
,
FaxSSetting
................................................... 39
6.1.17
FillOrder
................................................................... 40
6.1.18
FilterRatio
................................................................. 40
6.1.19
FitPage
...................................................................... 40
160
© PDF Tools AG – Premium PDF Technology
3-Heights™ PDF to Image Converter API, March 24, 2016 | 3/67
6.1.20
GetImage
..................................................................... 40
6.1.21
GetOcg
....................................................................... 40
6.1.22
HasAnnotations
............................................................. 41
6.1.23
HasColor
..................................................................... 41
6.1.24
HasPopups
................................................................... 41
6.1.25
ImageQuality
................................................................ 41
6.1.26
LicenseIsValid
............................................................. 42
6.1.27
OcgCount
..................................................................... 42
6.1.28
Open
......................................................................... 42
6.1.29
OpenMem
...................................................................... 42
6.1.30
Options
...................................................................... 43
6.1.31
PageCount
................................................................... 43
6.1.32
PageHeight
.................................................................. 43
6.1.33
PageWidth
................................................................... 44
6.1.34
PageNo
....................................................................... 44
6.1.35
PreserveAspectRatio
....................................................... 44
6.1.36
Quality
...................................................................... 44
6.1.37
RenderingMode
............................................................... 44
6.1.38
RenderPage
.................................................................. 45
6.1.39
RepeatWatermark
............................................................ 45
6.1.40
RotateMode
.................................................................. 45
6.1.41
SetBitmapDimensions
....................................................... 45
6.1.42
SetCMSEngine
................................................................ 46
6.1.43
SetCMYKProfile
............................................................. 46
6.1.44
SetLicenseKey
............................................................... 47
6.1.45
SetPageSize
................................................................. 47
6.1.46
SetsRGBProfile
............................................................. 47
6.1.47
SetWatermarkImage
.......................................................... 47
6.1.48
XDPI
,
YDPI
.................................................................... 48
6.2
Pdf2PdfImg
Interface .............................................................. 48
6.2.1
BitsPerPixel
................................................................ 48
6.2.2
Center
....................................................................... 48
6.2.3
Close
........................................................................ 48
6.2.4
CloseImage
.................................................................. 49
6.2.5
Compression
................................................................. 49
6.2.6
ConvertFile
................................................................. 49
6.2.7
CopyLinks
................................................................... 50
6.2.8
CopyOutlines
................................................................ 50
6.2.9
CopyViewerPreferences
..................................................... 50
6.2.10
CreateImage
................................................................. 50
6.2.11
CreateImageInMemory
....................................................... 51
6.2.12
Dithering
................................................................... 52
6.2.13
DPI
.......................................................................... 52
6.2.14
ErrorCode
................................................................... 52
6.2.15
FitPage
...................................................................... 52
6.2.16
GetPdf
....................................................................... 52
6.2.17
GrayScale
................................................................... 53
6.2.18
LicenseIsValid
............................................................. 53
6.2.19
Open
......................................................................... 53
6.2.20
OpenMem
...................................................................... 54
6.2.21
Options
...................................................................... 54
6.2.22
PageCount
................................................................... 54
92
© PDF Tools AG – Premium PDF Technology
3-Heights™ PDF to Image Converter API, March 24, 2016 | 4/67
6.2.23
PreserveAspectRatio
....................................................... 55
6.2.24
RenderingMode
............................................................... 55
6.2.25
RenderPage
.................................................................. 55
6.2.26
RepeatWatermark
............................................................ 55
6.2.27
RetainText
.................................................................. 56
6.2.28
RotateMode
.................................................................. 56
6.2.29
SetBitmapDimensions
....................................................... 56
6.2.30
SetLicenseKey
............................................................... 56
6.2.31
SetPageSize
................................................................. 56
6.2.32
SetWatermarkImage
.......................................................... 57
6.2.33
XDPI
,
YDPI
.................................................................... 57
6.3
Ocg
Interface ....................................................................... 57
6.3.1
Label
........................................................................ 57
6.3.2
Level
........................................................................ 58
6.3.3
Name
......................................................................... 58
6.3.4
Visible
...................................................................... 58
6.4
Enumerations ...................................................................... 59
6.4.1
TPDFColorSpace
............................................................. 59
6.4.2
TPDFCompression
............................................................ 60
6.4.3
TPDFDithering
............................................................... 61
6.4.4
TPDFErrorCode
............................................................... 61
6.4.5
TPDFPermission
............................................................. 62
6.4.6
TPDFRendererOption
......................................................... 63
6.4.7
TPDFRotateMode
............................................................. 65
7
Tips,Tricks and Troubleshooting ...................................................... 65
7.1
Font and Text Issues ................................................................. 65
7.1.1
Handle Non-Embedded Fonts ..................................................... 66
Font Replacement Strategy ................................................... 66
7.1.2
Handle Embedded Fonts ......................................................... 66
7.2
Transparency ....................................................................... 66
7.3
Page Orientation .................................................................... 67
8
Licensing and Copyright ............................................................ 67
9
Contact ........................................................................... 67
34
© PDF Tools AG – Premium PDF Technology
3-Heights™ PDF to Image Converter API, March 24, 2016 | 5/67
1Introduction
1.1 Description
The 3-Heights™ PDF to Image Converter API converts PDF documents into single page or multi-page raster images
such as TIFF or JPEG. It can also convert PDF files into rasterized PDF.
Its areas of use include the web, TIFF-based DMS solutions, archive and workflow systems and the protection of PDF
documents. The Converter is characterized by its high speed and outstanding quality.
PDF
PDF
Parameters
PDF to Image Converter
Renderer
GDI +
Windows GDI
Bitmap
TIFF Codec
JPEG Codec
PDF Codec
Other Codec
PDF
PDF
TIFF, JPEG,
Image
1.2 Functions
The 3-Heights™ PDF to Image Converter API merges pages from different input files to form one or more files. Color
space and image size are defined automatically during the process. The Converter supports scaled and un-scaled
conversions and a variety of image formats such as PNG, TIFF, JBIG2 or JPEG2000.
1.2.1 Features
Create single page and multi-page image files and rasterized PDF documents
Convert individual pages
Convert a PDF file into a PDF image file so that the new file contains the entire text and all the vector graphics
as raster images (to prevent text extraction, for instance).
Convert PDF files to CCITT fax files
39
© PDF Tools AG – Premium PDF Technology
3-Heights™ PDF to Image Converter API, March 24, 2016 | 6/67
Set page mode
Define page dimensions in points or pixels
Set rotation (identical to the incoming PDF document or portrait or landscape)
Resolution in DPI including X and Y direction
Dithering (Floyd Steinberg, Halftone Block, Halftone Continuous, Atkinson)
Set image filters
Set color depth
Set color space
Set TIFF file compression
Set the quality of lossy image compression
Set bit filling order for fax files
Define minimum line width
1.2.2 Formats
Input Formats
PDF 1.2, 1.3, 1.4, 1.5, 1.6, 1.7
PDF/A-1, PDF/A-2, PDF/A-3
Target Formats
TIFF (Tagged Image File Format)
JPEG (Joint Photographic Expert Group)
PNG (Portable Network Graphics)
GIF (Graphics Interchange Format)
BMP (Window Bitmap)
EPS (Encapsulated PostScript)
JBIG2 (Joint Bi-level Image Experts Group)
JPEG2000
Extended JPEG2000
PBM (Portable Bitmap File Format)
1.3 Interfaces
The following interfaces are available:
C
Java
.NET
COM
1.4 Operating Systems
The 3-Heights™ PDF to Image Converter API is available for the following operating systems:
Windows Vista, 7, 8, 8.1, 10 - 32 and 64 bit
Windows Server 2008, 2008 R2, 2012, 2012 R2 - 32 and 64 bit
43
© PDF Tools AG – Premium PDF Technology
3-Heights™ PDF to Image Converter API, March 24, 2016 | 7/67
2Installation and Deployment
2.1 Windows
The 3-Heights™ PDF to Image Converter API comes as a ZIP archive containing various files including runtime binary
executable code, files required for the developer, documentation and license terms.
1. Download the ZIP archive of the product from your download account at
https://www.pdf-tools.com
.
2. Unzip the file using a tool like WinZip available from WinZip Computing, Inc. at
http://www.winzip.com
to
a directory on your hard disk where your program files reside (e.g.
C:\Program Files\PDF Tools AG
)
3. Check the appropriate option to preserve file paths (folder names). The unzip process now creates the following
subdirectories:
bin
Contains the runtime executable binary code.
bin\Fonts
Contains required standard fonts and the font mapping file (seeFonts
).
bin\Icc
Contains color profiles and links to download additional color profiles
doc
Contains documentation files.
include
Contains header files to in include in your C / C++ project.
jar
Contains java archive files for java components.
lib
Contains the object file library to include in your C / C++ project.
samples
Contains sample programs in various programming languages
There is the option to download the software as MSI file, which makes the installation easier. Only one version
(32 or 64bit) can be installed using the MSI file. In order to install both versions the ZIP file should be used.
4. Optionally register your license key using theLicense Management
.
5. Ensure the two system environment variable
TMP
exist and point to an existing directory. This directory is re
quired to temporarily install fonts that are embedded in PDF documents.
Control Panel → System → Advanced → Environment Variables
13
© PDF Tools AG – Premium PDF Technology
3-Heights™ PDF to Image Converter API, March 24, 2016 | 8/67
6. Identify which interface you are using. Perform the specific installation steps for that interface described in
chapterInterface Specific Installation Steps
7. Make sure your platform meets the requirements regarding color spaces and fonts described in chaptersColor
Profiles
andFonts
respectively.
Ensure the system environment variable
TMP
exists and points to an existing directory. This directory is required to
temporarily install fonts that are embedded in PDF documents.
Control Panel → System → Advanced → Environment Variables
49
© PDF Tools AG – Premium PDF Technology
3-Heights™ PDF to Image Converter API, March 24, 2016 | 9/67
2.2 Interfaces
The 3-Heights™ PDF to Image Converter API provides four different interfaces. The installation and deployment of
the software depend on the interface you are using. The table below shows the supported interfaces and examples
with which programming languages they can be used.
Interface
Programming Languages
.NET
The MS software platform .NET can be used with any .NET capable programming language such
as:
C#
VB .NET
J#
others
This interface is available in the Windows version only.
Java
The Java interface.
COM
The component object model (COM) interface can be used with any COM-capable programming
language, such as:
MS Visual Basic
MS Office Products such as Access or Excel (VBA)
C++
VBScript
others
This interface is available in the Windows version only.
C
The native C interface is for use with C and C++.
2.2.1 Development
The software developer kit (SDK) contains all files that are used for developing the software. The role of each file with
respect to the four different interfaces is shown in tableFiles for Development
. The files are split in four categories:
Req This file is required for this interface.
Opt This file is optional. See also tableFile Description
to identify which files are required for your application.
Doc This file is for documentation only.
Empty field An empty field indicates this file is not used at all for this particular interface.
Files for Development
Name
.NET
Java
COM
C
bin\Pdf2ImgOCX.dll
Req.
Req.
Req.
Req.
Documents you may be interested
Documents you may be interested