Hi,
I've created a Windows Service in Delphi XE7 on my Windows 7 machine. The service converts docx to pdf like this:
a) connects to oracle and checks if docx need to be converted
b) finds a single docx and loads from database with:
m_BLOB := TOracleQuery.LOBField('BFile');
m_BLOB.SaveToFile(strFullPath);
c) then uses Word to open that file and save as pdf:
FWordApp := CreateOleObject('Word.Application');
FWordDoc := FWordApp.documents.open(strFullPathFiledoc,0,0);
FWordDoc.saveas(strFullPathFilepdf,17);
d) Now TLoblocator opens this pdf-file:
m_LOB := TLOBLocator.CreateTemporary(pSession, otBLOB, false );
LogMessage(datetimetostr(Now) + ' TService 1 LoadFromFile' , EVENTLOG_INFORMATION_TYPE, 0, 2);
m_LOB.LoadFromFile(strFullPath);
LogMessage(datetimetostr(Now) + ' TService 2 LoadFromFile' , EVENTLOG_INFORMATION_TYPE, 0, 2); // takes 6 sec
e) Sends m_LOB to the database
The Event viewer shows me that the last bit: loadfromfile takes
within one second on my local machine.
But when I move the service on to another machine, Windows 8,
the loadfromfile in d) takes 6 seconds, and that is not acceptable.
Have you any ideas on how to fix this?
My service on the "server" machine (windows 8) is running as an admin user.
The word-command in c) is doing a similar thing:
FWordDoc := FWordApp.documents.open(strFullPathFiledoc,0,0);
and that runs within 1 sec !
kind regards, Halli
I've created a Windows Service in Delphi XE7 on my Windows 7 machine. The service converts docx to pdf like this:
a) connects to oracle and checks if docx need to be converted
b) finds a single docx and loads from database with:
m_BLOB := TOracleQuery.LOBField('BFile');
m_BLOB.SaveToFile(strFullPath);
c) then uses Word to open that file and save as pdf:
FWordApp := CreateOleObject('Word.Application');
FWordDoc := FWordApp.documents.open(strFullPathFiledoc,0,0);
FWordDoc.saveas(strFullPathFilepdf,17);
d) Now TLoblocator opens this pdf-file:
m_LOB := TLOBLocator.CreateTemporary(pSession, otBLOB, false );
LogMessage(datetimetostr(Now) + ' TService 1 LoadFromFile' , EVENTLOG_INFORMATION_TYPE, 0, 2);
m_LOB.LoadFromFile(strFullPath);
LogMessage(datetimetostr(Now) + ' TService 2 LoadFromFile' , EVENTLOG_INFORMATION_TYPE, 0, 2); // takes 6 sec
e) Sends m_LOB to the database
The Event viewer shows me that the last bit: loadfromfile takes
within one second on my local machine.
But when I move the service on to another machine, Windows 8,
the loadfromfile in d) takes 6 seconds, and that is not acceptable.
Have you any ideas on how to fix this?
My service on the "server" machine (windows 8) is running as an admin user.
The word-command in c) is doing a similar thing:
FWordDoc := FWordApp.documents.open(strFullPathFiledoc,0,0);
and that runs within 1 sec !
kind regards, Halli
Last edited: