Page 1 of 1

Change font when generate PDF slow down

Posted: Sun Jun 03, 2018 11:58 am
by Victorio
Hi everybody,

I analyzed why generate large reports (about hundreds or thousands pages) need much time.
I examine use Pscript.dll and DCPS function and generate direct PDF.
But when in report I change font (DCPS FONT " ...) or DCPS SAY "something" FONT " ", this slow down proces and report generate about 50x longer when without change font.
For example report where use some font change need about 32 seconds , when disable any font changes need only 0.7 seconds. !!!

I mean calling DLLCALL PSSETFONTNAME need this time but do not know how to solve better, and has some relationship with calling windows functions.
Victorio

Re: Change font when generate PDF slow down

Posted: Sun Jun 03, 2018 2:29 pm
by rdonnay
You could use the DCPRINT system and a PDF printer driver.

Re: Change font when generate PDF slow down

Posted: Sun Jun 03, 2018 10:53 pm
by Victorio
DCPRINT and PDF printer I used previously, but had several problems, user need install third party program, (PDF Creator or other ) and this was problem because many clients have not admin access on his PC and was problem with install PDF Creator or Bullzip PDF, need some registry modify etc.

DCPS work good, very speed system, but I found this problem with font. I can disable FONT change, but then print reports do not look so nice.

Re: Change font when generate PDF slow down

Posted: Sun Jun 03, 2018 11:36 pm
by Victorio
Hi, problem solved :dance: , when modify
DCPS FONT "10.Arial CE Bold"
to
PSSetfont(APS_ARIAL,APS_BOLD,10)

now 1900 pages report need only 36 seconds !

Re: Change font when generate PDF slow down

Posted: Mon Jun 04, 2018 12:21 am
by Wolfgang Ciriack
It would be nice to see here your implemented solution.

Re: Change font when generate PDF slow down

Posted: Mon Jun 04, 2018 9:26 am
by Victorio
Example I have from this topic :
eXpress++ Support Topic: Support for PageScript now in eXpress++

but I only replace
DCPS FONT "10.Times New Roman"
with direct call
PSSetFont(APS_TIMES,APS_PLAIN,10)
or
PSSetFont(APS_TIMES,APS_BOLD,10)
or
PSSetFont(APS_COURIER,APS_PLAIN,10) etc.

Using DCPS generate PDF is very very slower, maybe because need some processing :
#command DCPS FONT <cFont> [COLOR <nFG> [,<nBG>]] ;
=> ;
DC_PsSetFont( <cFont>, <nFG>, <nBG> )

and then DC_PsSetFont call Pssetfont :

FUNCTION DC_PsSetFont( cFont, nFG, nBG )

LOCAL aFont := DC_FontCompoundName2Ps( cFont )
LOCAL aColor := DC_Color2PS( nFG, nBG )

RETURN PsSetFont( aFont[1], aFont[3], aFont[2], aColor[1], aColor[2] )

I do not examine what process use time, that slows processing, other function as DCPS LINE, DCPS SAY ... works without problem.