I'm attempting to create pdfs within a service. This worked fine under version 1.59. When we moved to version 2.1 I'm getting an Access violation when the BeginDoc is called. When the service is created I create a PDF printer using PDFDriverInit. In separate threads when a report is requested I attach to the PDF printer using DriverInit. I'm calling EnablePrinter and SetLicenseKeyA immediately before calling BeginDoc.
Sample of code: (Delphi 5.01)
Code: Select all
PDFHandle := DriverInit(PChar(cPDF_PRINTER));
if PDFHandle <> 0 then begin
SetPrinter(PChar(cPDF_PRINTER), '', '', 0);
SetDefaultFileName(PDFHandle, PChar(FileName));
SetFileNameOptions(PDFHandle, NoPromt + UseFileName);
EnablePrinter(PDFHandle, 'xxxx', 'xxxxxx');
SetLicenseKeyA('xxxx', 'xxxxxx');
Printer.Title := 'xxxx';
Printer.BeginDoc;
....
....
Printer.EndDoc;
end;
Do you have any idea of why this would work under version 1.59 but not under 2.1? The code is the same except for the calls to EnablePrinter and SetLicenseKeyA.
Thanks in advance for your help.
John