PDF to IMAGE COM |
1. Overview |
Pdf to Image SDK is a powerful pdf sdk/api, it produces fully functional image documents with text, pictures, graphics etc, using the original pdf document formatting. It does not need any software support, such as Adobe Acrobat, Acrobat Reader, etc. |
The primary functions are listed following. | |
(01) | It quickly convert pdf document to image document. |
(02) | It supports CCITT fax image files. |
(03) | It supports encrypted pdf file. |
(04) | It supports to select individual pages for conversion. |
(05) | It supports conversion of vector graphics into image files. |
(06) | It supports multifarious image format, such as 'bmp', 'tiff', 'jpg', 'gif', 'png', 'emf', 'wmf', 'pcx' etc. |
(07) | It supports to generate multipage tiff files. |
(08) | It supports any resolution in the generated image files. |
(09) | It supports conversion into color 1bit, 4bits, 8bits,4bits grayscale, 8tits grayscale and 24bits per pixel format image. |
(10) | It supports multifarious compression of tiff image, such as LZW, JPEG, PACKBITS, CCITT Group3, CCITT Group4, RLE etc. |
(11) | It allows you to preserve original document layout. |
(12) | It supports windows 2000/xp/2003/vista and windows 7 platform. |
(13) | It does not require Adobe Acrobat or Reader support. |
(14) | It supports Adobe Acrobat 3.0, 4.0, 5.0, 6.0 compatibility. |
2. Installation&Uninstallation |
(1) Installation PDF to IMAGE COM |
The PDF to IMAGE SDK/COM is a zip archive,which contains various files including runtime binary executable codes, developer's samples and documents,and license file etc. You can unzip the archive using a tool like WinZip or WinRAR. The archive contians the following subdirectories. |
bin: It contians the runtime binary executable codes. | |
doc: It contians the user's manuals and license file. | |
include: It contians header files which included in your vc,c++builder,delphi or other development platforms. | |
samples: It contians vc,vb,c++builder,delphi,c#,vb.net,asp and asp.net sample programes and so on. |
step 1. | Copy the files pdf2image.dll and pdf2image.ocx,which placed at the archive's subdirectory 'bin', to windows system directory. | |
for example | ||
。copy pdf2image.dll c:\windows\system | ||
。copy pdf2image.ocx c:\windows\system |
step 2. | Register the component pdf2image.ocx in your system using the regsvr32 program that is provided with the windows operating system. | |
for example | ||
。regsvr32 pdf2image.ocx |
3. System requestment |
Supported Operation Systems |
The following operation systems listed have been tested with PDF to IMAGE COM and are officially supported. |
(1) Microsoft Windows 2000 Professional; |
(2) Microsoft Windows 2000 Server and Advanced Server; |
(3) Microsoft Windows 2003 Server 32-bit Web Edition, Standard Edition and Enterprise Edition; |
(4) Microsoft Windows XP Professional and Home Edition; |
(5) Microsoft Windows Vista Ultimage and Home Edition; |
(6) Microsoft Windows 7. |
Recommended hardware |
(1) CPU: Intel(or Standard PC) 800MHz or faster compatible x86 processor; |
(2) RAM: 256MB or more RAM recommended, 128MB minimum; |
(3) Hard-disk: 100MB free space recommended, 50MB free space required; |
4. Getting Started |
|
(4) Using Pdf to Image SDK/COM in .NET 2003 |
This section describes how to use Pdf to IMAGE SDK/COM quickly in .Net 2003, after installing and registering the SDK/COM component. |
step 1. Creating a application project. |
The first, creating a new Standard-Exe Visual Basic(or c#) .NET project and saving the project to the directory which you like. |
step 2. Adding the component to the project. |
![]() |
step 3. Drawing a new button and coding the click event. |
Drawing a new command button(and rename it if you like) so that you have something similar to this:![]() Then double clik the button 'demo1' and code it looks like the following: Private Sub btnDemo1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDemo1.Click Dim AxPdf2Image As New AP_PDF2IMAGE.AxPdf2Image Dim nHandle As Integer Dim sFileName As String sFileName = "d:\\sample1.pdf" |
Notice: For more detial, please see the VB.NET(or C#.NET) sample which is included in samples/VB.NET2003(or samples/CShare.NET2003). |
(5) Using Pdf to Image SDK/COM in ASP |
This section describes how to use Pdf to IMAGE SDK/COM quickly on ASP, after installing and registering the SDK/COM component. The class name of the Pdf to IMAGE SDK/COM is Pdf2ImageCOM.pdf2image. |
The following is a ASP sample. |
<% '----------------------------------------------------------------------------------------------------------------------------- Call doMain() '----------------------------------------------------------------------------------------------------------------------------- sub doMain() 'Create com object. Set AxPdf2Image = Server.CreateObject("Pdf2ImageCOM.pdf2image") 'Open pdf file and creating a converter. 'It return a handle of the created converter. sPdfFile = "d:\\sample1.pdf" nHandle = AxPdf2Image.apOpen(sPdfFile,"","") Select Case nHandle Case ERR_OVER_MAXTHREADS Response.write "Open '"+sPdfFile+"' failure - Over the limit amount of threads,please waiting!<br>" exit sub Case ERR_FILE_UNEXIST Response.write "Open '"+sPdfFile+"' failure - Source pdf file unexist!<br>" exit sub Case ERR_FILE_DAMAGED Response.write "Open '"+sPdfFile+"' failure - Source pdf file damaged!<br>" exit sub Case ERR_FILE_RESTRICTED Response.write "Open '"+sPdfFile+"' failure - Source pdf file restricted!<br>" exit sub End Select Response.write "Open '"+sPdfFile+"' ok!<br>" 'Setting properties. For more,please refer to user manual. AxPdf2Image.sOutDirectory = "d:\\demo1" 'output directory AxPdf2Image.iXDPI = 120 'horizontal dpi AxPdf2Image.iYDPI = 120 'vertical dpi iPageCount = AxPdf2Image.apGetPageCount(nHandle) Response.write "The Amount of the pdf pages is "+cstr(iPageCount)+".<br>" 'To convert the pdf file. For iPageNo = 1 to iPageCount Response.write " Converting the page "+cstr(iPageNo)+"......<br>" AxPdf2Image.apConvertPage nHandle,iPageNo Next 'Close pdf file and destory the converter. AxPdf2Image.apClose nHandle Response.write "Close '"+sPdfFile+"' ok!<br>" end sub %> |
Notice: For more detial, please see the ASP sample which is included in samples/ASP. |
5. SDK/COM reference |
(1) Methods |
|
。 Method --- apOpen() |
This method opens a pdf file, if the pdf file is restricted, you can ensure owner password or user password. After it opens success, it will create a converter and return the converter's handle. |
Syntax |
long apOpen(char *pPdfFileName, char *pOwnerPw, char *pUserPw); |
Parameters |
pPdfFileName: Source pdf file name. It supports absolute path and relative path. | |
pOwnerPw: Pdf owner password. | |
pUserPw: Pdf user password. |
Return value |
If the function succeeds, it returns a converter's handle. If the function fail, it returns a error code, such as the following, for more error codes, please click here. |
ERR_OVER_MAXTHREADS: Over the limit amount of threads. | |
ERR_FILE_UNEXIST: Source pdf file unexist. | |
ERR_FILE_DAMAGED: Source pdf file is damaged, or not a correct pdf file. | |
ERR_FILE_RESTRICTED: Source pdf file is restricted, such as password is wrong etc. |
。 Method --- apClose() |
This method close the pdf file and destroy the converter appointed by the handle. |
Syntax |
long apClose(long nHandle); |
Parameters |
nHandle: The converter's handle, which created by method---apOpen. |
Return value |
It returns RTN_OK, the function succeeds, otherwise the function fails. For more error codes, please click here. |
。 Method --- apConvert() |
This method converts all pages of the pdf file. |
Syntax |
long apConvert(long nHandle); |
Parameters |
nHandle: The converter's handle, which created by method---apOpen. |
Return value |
It returns RTN_OK, the function succeeds, otherwise the function fails. For more error codes, please click here. |
。 Method --- apConvertPage() |
This method converts a certain page of the pdf file, the page appointed by the second parameter---nPageNo. |
Syntax |
long apConvertPage(long nHandle,long nPageNo); |
Parameters |
nHandle: The converter's handle, which created by method---apOpen. | |
nPageNo: A certain page of the pdf file, which will be converted. |
Return value |
It returns RTN_OK, the function succeeds, otherwise the function fails. For more error codes, please click here. |
。 Method --- apConvertPageToStream() |
This method converts a certain page of the pdf file to memory stream, the page appointed by the second parameter---nPageNo. |
Syntax |
long apConvertPageToStream(long nHandle, long nPageNo, BYTE *&pMemStream, long &nSize); |
Parameters |
nHandle: The converter's handle, which created by method---apOpen. | |
nPageNo: A certain page of the pdf file, which will be converted. | |
pMemStream: A pointer of memory stream, which point to result image's memory stream. | |
nSize: It is the size of memory image stream. |
Return value |
It returns RTN_OK, the function succeeds, otherwise the function fails. For more error codes, please click here. |
Notice: | The result image's memory stream managed by the sdk automatically, you need not to allocate or destory it manually. If this method is invoked successful, the properties iStreamHandle and iStreamSize become valid right now. The property iStreamHandle shows the handle of memory stream of the image which are previously saved using apConvertPageToStream(), and the property iStreamSize shows the size of the stream in byte. |
。 Method --- apGetPageCount() |
This method is to get the number of pages in the PDF document. |
Syntax |
long apGetPageCount(long nHandle); |
Parameters |
nHandle: The converter's handle, which created by method---apOpen. |
Return value |
If the method works successful, it returns the number of pages in the PDF document, otherwise the method works failure. For more error codes, please click here. |
。 Method --- apGetPageWidth() |
This method is to get the width of a pdf page. Afert the method apConvertPage() or apConvertPageToStream() is invoked successful, this method becomes valid. |
Syntax |
long apGetPageWidth( long nHandle); |
Parameters |
nHandle: The converter's handle, which created by method---apOpen. |
Return value |
If the method works successful, it returns the width of a pdf page, otherwise the method works failure. For more error codes, please click here. |
。 Method ---apGetPageHeight() |
This method is to get the converter's properties, which created by method---apOpen. |
Syntax |
long apGetPageHeight( long nHandle); |
Parameters |
nHandle: The converter's handle, which created by method---apOpen. |
Return value |
If the method works successful, it returns the height of a pdf page, otherwise the method works failure. For more error codes, please click here. |
(2) Properties |
This section describes the properties of the converter detailedly. |
。Property String sOutDirectory |
This property can be using to set output directory which the result image files placed in. Default the output directory as same path as the source PDF document. |
。Property String sOutPrefix |
This property can be using to set the prefix of file name of the result image. For example, the file name of source pdf is 'test.pdf', you set the image type as 'JPEG' format and the value of this property as 'mytest', so the file name of result image are 'mytest00001.jpg', 'mytest00002.jpg',...,'mytest00XXX.jpg', etc. |
。Property Integer iPageZoom |
Th property can be using to set zoom scale of PDF pages(10-200). For example, if it sets the page zoom as 120 or 80 and the result image is a 800x600 pixel, so the final result image is a 960x720 pixel or 640x480 pixel image. Default page zoom is 100. |
。Property Integer iImageType |
This property can be using to set the result image type. The supported image formats are listed below: |
|
。Property Integer iBitCount |
This property gets or sets the color depth of an image. The component supports the following color depths,default is 24. |
1: black/white image. | |
4: 16 colors image. | |
8: 256 colors image. | |
24: true color image. |
。Property Integer iXDPI |
This property gets or sets the horizontal resolution of the image. The component supports the resolution from 72 to 500, defualt is 120. |
。Property Integer iYDPI |
This property gets or sets the vertical resolution of the image. The component supports the resolution from 72 to 500, defualt is 120. |
。Property Integer iXDimensions |
This property can be used to specify the width of the final result image in pixel. |
。Property Integer iYDimensions |
This property can be used to specify the height of the final result image in pixel. |
。Property Integer iCompression |
Only the current output images are tiff format, this property is valid, the property can be used to get or set the compression type. The supported value of iCompression are listed below(supported color depths in brackets): |
|
。Property Integer iQuality |
This property gets or sets the compression quality(1..100) for lossy compression types. Default is 75. |
。Property Boolean iGrayscale |
This property can be using to set grayscale image. |
TRUE(1): It is to set grayscale image. | |
FALSE(0): It is to set non-grayscale image. |
。Property Boolean iMultiPages |
This property can be using to set multipages tiff files. |
TRUE(1): It is to set multipages tiff files. | |
FALSE(0): It is to set general tiff files. |
。Property Integer iStreamHandle |
A read only property, it can not be set. If only the method apConvertPageToStream() is invoked successful, this property becomes valid and shows the handle of memory stream of the image which are previously saved using method apConvertPageToStream(); Notice: The stream managed by the component automatically, you need not to allocate or destory it manually. |
。Property Integer iStreamSize |
A read only property, it can not be set. If only the method apConvertPageToStream() is invoked successful, this property becomes valid and shows the size of memory stream of the image in byte. The stream are previously saved using method apConvertPageToStream(). |
。TIFF compression tag's definitions(supported color depths in brackets) |
|
。Image type's definitions |
|
。Return code's definitions |
|
6. How to ... |
(1) How to create multipages tiff images? |
The TIFF image format is a especial image format, which supports multipages images.Using Pdf to IMAGE SDK/COM to create multipages tiff images is very easy. All you need to is setting the multipages property to TRUE(or 1). | |
It looks like the following. |
AxPdf2Image.iMultiPages = TRUE; (or) AxPdf2Image.iMultiPages = 1; |
A completed code for creating multipages tiff in VB. |
Dim AxPdf2Image As New AP_PDF2IMAGE.AxPdf2Image |
Notice: For more detial samples please here to download PDF to Image SDK/COM samples. |
(2) How to create memory stream images? |
The Pdf to Image SDK supports to convert pdf file to memory stream. You can save the memory stream to database, to file, or to others, etc. |
The following is a VB sample that save the memory stream to file. |
Dim AxPdf2Image As New AP_PDF2IMAGE.AxPdf2Image |
Notice: For more detial samples please here to download PDF to Image SDK/COM samples. |
(3) How to increase/decrease the file size of an image? |
This section will tell you how to increase/decrease the file size of an image. The main factors on which the file size of an image defpend are listed at the following: |
Page zoom | |
Resolution (DPI) | |
Dimensions(width and height) | |
Bits per pixel | |
Compression type | |
Compression quality |
So you can control image's zoom scale with adjusting the value of above parameters. |
The Page zoom is used to set zoom scale of PDF pages(10-200). For example, if it sets the page zoom as 120 or 80 and the result image is a 800x600 pixel, so the final result image is a 960x720 pixel or 640x480 pixel image. Default page zoom is 100. |
To set page zoom like this: | |
AxPdf2Image.iPageZoom = 120 |
The DPI(dots per inch) value let you specify how detialed the image is. A larger DPI value generates a more detialed image, but also will make the size of the image file larger. On the other hand, a lower DPI value generates files of smaller size, but the image is also of lower quality.The system supports from 72 to 500 DPI, default is 120 DPI. |
To set resolution like this: | |
AxPdf2Image.iXDPI = 150 AxPdf2Image.iYDPI = 150 |
The dimensions of an image can be set in pixel. By setting the dimensions of an image, you can specify the width or height of the final result image in pixel. Increasing/Decreasing the dimensions will affect the amount of total pixel. Obviously a 1024x768 pixel image has a larger file size and more detialed than a 800x600 pixel image. |
To set the dimensions of an image like this: | |
AxPdf2Image.iXDimensions = 1024 AxPdf2Image.iYDimensions = 768 |
Setting the color depths of an image, you can adjust the image's size as you like. Such as 1-bit(black/white), 4-bits or 8-bits grayscale instead of 24-bits true color will reduce the size of the image files, but not all formats support all color depths. |
To set bits count per pixel like this: | |
AxPdf2Image.iBitCount = 8 |
The component supports various image formats, such as BMP,JPEG,TIFF,GIF,PNG,EMF,WMF,PCX etc, but only the TIFF format supports to set compression type and the jpeg format or the tiff format which encoded by jpeg compression support to set compression quality. An appropriated compression type generates a more smaller size of image files. A larger compression quality generates a more detialed image, but also will make the size of the image file larger. On the other hand, a lower compression quality generates file of smaller size, but the image is also of lower quality. The system supports from 1 to 100 quality, default is 75. |
To set compression type like this: (only the type of image is tiff.) |
|
AxPdf2Image.iCompression = AP_TIFF_COMPRESSION_LZW | |
To set compression quality like this: (only the type of image is jpeg, or tiff which encoded by jpeg compression.) |
|
AxPdf2Image.iQuality = 65 |
Notice: For more detial samples please here to download PDF to Image SDK/COM samples. |
7. Registration |
(1) Demo version |
You can free download a demo version at http://www.adultpdf.com/products/pdftoimage/index.html |
Limitations of the demo version: You are allowed to process only up to 10 pages of each pdf files simultaneously. |
(2) Buy now |
You can order PDF to IMAGE SDK/COM online. Click here to the product site. 。PDF to IMAGE SDK/COM 5threads, only $479, buy now. 。PDF to IMAGE SDK/COM 10threads (recommend), only $679, buy now. 。PDF to IMAGE SDK/COM 10+threads, only $879, buy now. Click Server License to read the sdk/com license, thanks for your support. |
(3) Technology support |
Guarantee: We are committed to providing excellent products and support to our customers. If you are dissatisfied with a adultpdf product after your purchase, we will refund your money. Privacy Policy: We will not give, sell or otherwise transfer your personal information to third parties. Unless you ask us not to, we will send occasional email about new products and releases. Ongoing Open Dialog: Our customers are our most valuable resource. Please let us know how we can improve our products and we will try our best to implement your suggestions. |
If you have some questions about
registering our product(s),or programe bugs,or suggestions of our product(s),or suggestions of our site,we will welcome you to contact us. Our sales email: sales@adultpdf.com Our support email: support@adultpdf.com |
8. Copyright&License |
THIS IS A CONTRACT. PLEASE READ THIS SOFTWARE LICENSE AGREEMENT CAREFULLY You agree that all of the terms and conditions below apply to you and (1)YOU COPY, INSTALL, OR USE THIS COPY OF PDF to IMAGE SDK/COM SOFTWARE, OR If you do not agree with all of the terms and conditions of this agreement, (1) IMMEDIATELY CEASE USING THE SOFTWARE 1. License 2. Scope of use. 3. Transfer 4. Updated Versions 5. Limitation of Liability 6. Termination 7. Installation 8. Refunds |
http://www.adultpdf.com |
Copyright 2000-2009 by AdultPDF Technology, Inc. All rights reserved. |