Change font when generate PDF slow down

This forum is for eXpress++ general support.
Post Reply
Message
Author
Victorio
Posts: 620
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Change font when generate PDF slow down

#1 Post 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

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Change font when generate PDF slow down

#2 Post by rdonnay »

You could use the DCPRINT system and a PDF printer driver.
The eXpress train is coming - and it has more cars.

Victorio
Posts: 620
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: Change font when generate PDF slow down

#3 Post 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.

Victorio
Posts: 620
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: Change font when generate PDF slow down

#4 Post 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 !

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Change font when generate PDF slow down

#5 Post by Wolfgang Ciriack »

It would be nice to see here your implemented solution.
_______________________
Best Regards
Wolfgang

Victorio
Posts: 620
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: Change font when generate PDF slow down

#6 Post 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.

Post Reply