Setup:
* Windows XP Home Edition with SP2
* Delphi 5 Enterprise
* Amyuni PDF Converter 2.50b-3 (Developer Version)
I've uninstalled all previous versions of Amyuni (RAPID PDFWriter & PDF Converter 2.10 Evaluation Version) and installed PDF Converter 2.50 (entering the License and Activation codes in the PDF Converter installation). The problem is that I cannot print (i.e., save to file) anything with the Developer Version. I've copied and slightly modified the example Delphi code (see below) provided on the Amyuni website, but to no avail - I can step through all the code and it appears to be okay (i.e., none of the function calls return an error code), but no file is ever produced.
Any suggestions? I can provide you with the original License & Activation codes if they will help.
Thanks in advance,
Fiachra
Code: Select all
function DriverInit(PrinterName: PChar): LongInt; stdcall; external 'cdintf250.dll' name 'DriverInit';
function SetDefaultDirectory(Printer: LongInt; Directory: PChar): LongInt; stdcall; external 'cdintf250.dll' name 'SetDefaultDirectory' ;
function SetDefaultFileName(Printer: LongInt; FileName: PChar): LongInt; stdcall; external 'cdintf250.dll' name 'SetDefaultFileName';
function SetFileNameOptions(Printer: LongInt; Options: SmallInt): LongInt; stdcall; external 'cdintf250.dll' name 'SetFileNameOptions';
function SetDefaultPrinter(Printer: LongInt): LongInt; stdcall; external 'cdintf250.dll' name 'SetDefaultPrinter';
function EnablePrinter(Printer: LongInt; LicensedTo: PChar; ActivationCode: PChar): LongInt; stdcall; external 'cdintf250.dll' name 'EnablePrinter';
procedure TMainForm.PrintDLLClick(Sender: TObject);
const
NoPrompt = 1;
UseFileName = 2;
OutputDirectory = 'C:\TEMP';
OutputFileDLL ='C:\TEMP\DLLTEST.PDF';
PrinterName = 'Amyuni PDF Converter';
DocName = 'My Document';
LicensedTo = 'Private'; // I do enter the actual license value here.
ActivationCode = 'Private'; // I do enter the actual activation code here.
var
pdf: LongInt;
begin
pdf := DriverInit(PrinterName);
SetDefaultPrinter(pdf);
if SetDefaultDirectory(pdf, OutputDirectory) = 1 then
begin
if SetDefaultFileName(pdf, OutputFileDLL) = 1 then
begin
if SetFileNameOptions(pdf, NoPrompt + UseFileName) = 1 then
begin
if EnablePrinter(pdf, LicensedTo, ActivationCode) = 1 then
begin
RichEdit1.Print(DocName);
SetFileNameOptions(pdf, 0);
end;
end;
end;
end;
end;