PDF2Image.dll ============= You can use it with all well known ides (.NET-IDEs, too!) Try it with Visual Basic, VBA, CSharp, VB2008 (Express), Delphi, C, C++, ... ================================ This is the shareware version! This means "try before you buy"! If you think this dll can be useful for your work please order the unlimited version at: www.PDF-Analyzer.com This version isn't limited in any cases 'cause you should be able to test the whole functionality. There are only one difference to a sold version: The message window at programstart. ================================ You can get the unlimited version from: --------------------------------------- Ingo Schmoekel - Software-Dev. and Distribution - Zedernstr. 30a D-28832 Achim GERMANY Webmaster@PDF-Analyzer.com order pages are here: http://www.PDF-Analyzer.com http://www.IS-Soft.de The dll works with all types of normal pdf-documents from pdf-specs 1.2 up to the new specs. It doesn't mind if there's an AES- or RC4-encryption ... nothing, 40 or 128 bit ... even a main-/owner-password isn't a problem! What you can't use are pdf-documents protected with a user-password (the one you have to insert before reading the document-content on the screen). About installation and working with the dll... ---------------------------------------------- This dll doesn't have an entry point so it's not necessary to register it. Only copying into the system32-directory or in the directory where your application is installed. Please keep in mind: If you're working inside the IDE from VB 6.0 the file PDF2Image.dll should be in the VB98-directory 'cause then the application is VB 6.0 and not the project you're testing. If you're working inside the IDE from VB 2005 Express the file PDF2Image.dll should be in the bin-directory (under your project-directory). If you're using vba (from ms access or excel for example) you should declare the functions as private and not public. Using .NET-environments (like MS Visual Studio) it's often better (to avoid stack imbalance errors) to change the parameter-types from longinteger to integer or int32 /vb2005). If you want to use it in an asp environment... Using for example Windows 2003 you should have a look at the "Data Execution Prevention (DEP)". The "DEP" should be disabled for the process using the PDF2Image.dll! How to do it: The "DEP" should be disabled for the w3wp.exe process (located in c:\windows\system32\inetsrv). Go to the "system properties" -> "performance options" -> The tab "Data Execution Prevention" -> "Turn on DEP for ... except those i select" -> Here you have to mark the "IIS Worker Process". At the end you have to perform an IISreset at the command prompt. That's all ... in this way the PDF2Image.dll can work in an asp environment (for example with Windows 2003). If you want to use it in a 64 bit environment... PDF2Image.dll is a 32 bit dll but you can use it in 64 bit environments, too. For example on Win XP Pro x64 the calling application should be installed in the "program Files (x86)" directory and it'll work. If you want to insert the dll in the system32-directory: This directory is used only for 64 bit dlls if it's a 64 bit system. In this case the PDFtext.dll (= 32 bit) should be in the SysWOW64-directory. The library itself ------------------ PDF2Image.dll (in the windows\system32- or in your application-directory) For the library there is a help-program to test the function immediately: ------------------------------------------------------------------------- H_PDF2Image.exe As source example there is a delphi-project included: ----------------------------------------------------- PDF2Image_delphi.zip contact: webmaster@pdf-analyzer.com info/help: http://www.pdf-analyzer.com http://www.is-soft.de Ingo Schmoekel - Software-Dev.& Distribution - Zedernstr.30a D-28832 Achim - Uesen GERMANY Kinds of returned (error) codes for GetPDFPageCount: ---------------------------------------------------- 9001 = File not found or not readable 9002 = No pdf-file 9003 = File not readable 'cause an encrypted cross-reference If it's all okay the pagecount of the selected document will be returned. Kinds of returned (error) codes for GetPDFImage: ------------------------------------------------ 9001 = File not found or not readable 9002 = No pdf-file 9003 = File not readable 'cause an encrypted cross-reference 9004 = No target file 9005 = Target path isn't valid 9006 = Imagetype isn't valid (bmp, gif, jpg, tif, png, wmf, eps and emf are valid) 9011 = There's a user password ... no textextraction 9013 = The pdf has a structure problem ... the creation wasn't proper 0 = The pdf-page couldn't be rendered 1 = Imagecreation was okay 2 = The image couldn't be written to disk If it's all okay normally the "1" will be returned. functions with the type of values and the meaning: -------------------------------------------------- GetPDFPageCount function GetPDFPageCount(const FileName: PChar): LongInt; stdcall; GetPDFImage function GetPDFImage(const FileName: PChar; target: PChar; page: LongInt; dpi: LongInt): LongInt; stdcall; FileName -------- That's the pdf-file and can't be empty ;-) target ------ Existing drive and path with a new filename for the image-file which shall be created. Bmp, gif, jpg, tif, png, wmf, eps and emf are valid image-types. page ---- The pagenumber which shall be used. Valid pagenumbers are between 1 and 99999. If you're using a pagenumber above the max. pagecount of a document then value 1 will be used. dpi --- Will be the resolution of the created image. Valid values are between 1 and 300. More than 300 will result in too bad performance. Often 72 dpi should be enough... Sample for delphi: Including the dll in a delphi unit ----------------------------------------------------- unit H_PDF2Image1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Edit2: TEdit; Label1: TLabel; Label2: TLabel; Label3: TLabel; Edit3: TEdit; Label4: TLabel; Button3: TButton; Edit7: TEdit; Edit1: TEdit; Edit4: TEdit; Edit5: TEdit; Label5: TLabel; Label6: TLabel; OpenDialog1: TOpenDialog; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Edit5Exit(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Edit1Change(Sender: TObject); private { Private-Deklarationen } public { Public-Deklarationen } end; var Form1: TForm1; function GetPDFImage(const FileName: PChar; target: PChar; page: LongInt; dpi: LongInt): LongInt; stdcall; function GetPDFPageCount(const FileName: PChar): LongInt; stdcall; implementation {$R *.DFM} function GetPDFImage(const FileName: PChar; target: PChar; page: LongInt; dpi: LongInt): LongInt; stdcall; external 'PDF2Image.dll'; function GetPDFPageCount(const FileName: PChar): LongInt; stdcall; external 'PDF2Image.dll'; procedure TForm1.Button1Click(Sender: TObject); begin If OpenDialog1.Execute Then Edit1.Text := OpenDialog1.FileName; end; procedure TForm1.Button2Click(Sender: TObject); begin Edit2.Text := IntToStr(GetPDFImage(PChar(Edit1.Text), PChar(Edit3.Text), StrToInt(Edit5.Text), StrToInt(Edit4.Text))); end; procedure TForm1.Edit1Change(Sender: TObject); begin Edit3.Text := Edit1.Text + '.jpg'; end; procedure TForm1.Edit5Exit(Sender: TObject); begin If ( StrToInt(Trim(Edit5.Text) ) > 99999 ) or ( StrToInt(Trim(Edit5.Text) ) < 1 ) Then Edit5.Text := '1'; end; procedure TForm1.Button3Click(Sender: TObject); begin Edit7.Text := IntToStr(GetPDFPageCount(PChar(Edit1.Text))); end; end. . . .