You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Olivier Imbert <Ol...@jway.lu> on 2003/04/25 18:30:58 UTC

Rendering PDF with EPS graphics in it

Hi all,
I sent the mail hereafter on the user list but nobody answer so I send it here 
...

 I have to render PDF including EPS graphics.
 Everything renders fine using FOP 0.20.4.
 I got a performance issue when printing on a PostScript printer  (several
 types used) thru Acrobat Reader : for each page including EPS graphics the
 printer spend a lot of time (formatting ?) before printing.
 Printing an equivalent document from WordPerfect to the postscript printer
 works fine.
 Any idea ? Is there anything I can tune in the way FOP encapsulate EPS in
 PDF ?

One thing I cannot understand is why fop insert a "scale" command before the 
eps content and why this scale command is linked to the bounding box of the 
eps ... The scale parameter seem very small also ...

For the same EPS file I got the fop following generation :

%%BeginDocument: file:d:/notices/img/3_go.eps
userdict begin                 % Push userdict on dict stack
/PreEPS_state save def
/dict_stack countdictstack def
/ops_count count 1 sub def
/showpage {} def
0.001976284584980237 0.007194244604316547 scale
-17 -17 translate
17 17 506 139 rectclip
newpath
%!PS-Adobe-2.0 EPSF-1.2
%%BoundingBox: 17 17 523 156
....
                  
On the other hand WordPefect thru PS Printer driver throw the following things 
:
%%BeginDocument: Pscript_Win_PassThrough  
save		%get ready to output an eps file 
/b4_Inc_state save def 
/dict_count countdictstack def 
/op_count count 1 sub def 
userdict begin 
/showpage {} def 
0 setgray 0 setlinecap 
1 setlinewidth 0 setlinejoin 
10 setmiterlimit [] 0 setdash newpath 
/languagelevel where 
{pop languagelevel 
1 ne 
  {false setstrokeadjust false setoverprint 
  } if 
} if 
 
1734 5380  moveto 
2819 0  rlineto 
0 774  rlineto 
-2819 0  rlineto 
closepath clip newpath 
[5.55891 0.0 0.0 -5.48489 1639.50933 6247.49420 ] concat 
%!PS-Adobe-2.0 EPSF-1.2
%%BoundingBox: 17 17 523 156

Any idea or suggestion will be welcome ...

 Thanks in advance,
 Olivier.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Rendering PDF with EPS graphics in it

Posted by Jeremias Maerki <de...@greenmail.ch>.
On 02.05.2003 08:37:05 Olivier Imbert wrote:

<snip/>

> > Anyway, I'm not a pro in PostScript yet and I haven't dealt with
> > performance problems so I'm not a big help here. Maybe you could find
> > some advice in a place dedicated to PostScript. If you find anything we
> > would be glad to hear from you.
> >
> > Have you tried to use SVG instead of EPS?
> 
> I try that but I got two kinds of issue :
> - I am not able to take care of the bounding box I defined in the EPS ... I 
> don't know if it is an EPS to SVG problem or a Batik problem. I use 
> "pstoedit" to convert. Have you another suggestion ?

I did successful conversions using Adobe Illustrator and CorelDraw in
the past.

> - It seems that batik transform the SVG vectors to a bitmap image so I lost 
> quality. Is there a way to transform batik directly to PDF drawing dirrective 
> ?

Nah, not bitmaps. Fonts are painted as shapes and if Acrobat Reader has
smoothing disabled you get the impression of a bitmap file. See:
http://xml.apache.org/fop/graphics.html#svg-pdf-text
>  
> > I hope this helps a bit.
> 
> Yes it's help a bit ! Thanks !
> I continued to investigate and another track could be the fact that my EPS 
> graphics are encapsulated into several fo:table (fo:table within an 
> fo:table-cell) ... During fo:table to PDF generation is there some heavy code 
> generated ? (scaling ?)

I don't think so. Only a translation matrix or a moveto for the
indentation. But it is known that FOP's performance (not the printer's)
may suffer when a lot of table stuff is used.


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Rendering PDF with EPS graphics in it

Posted by Olivier Imbert <Ol...@laposte.net>.
Thanks for your answer Jeremias.

> Unfortunately, I don't have access to a PostScript printer ATM so I
> could test myself. But you could try the following to circle in possible
> causes:
> - Create a PostScript file from the PDF by printing to a file instead of
>   to the printer.
> - Edit the PostScript file and play with the code by commenting out one
>   or more lines containing the "scale", "transform" etc. to see if the
>   processing speed changes (even though the output won't be good
>   anymore).

About playing with the scale stuff in the EPS wrapper : I will try that.

> - The rest of the wrapper code doesn't look all that different but fact
>   is that quite some data has to be pushed on the stack. This might be
>   possible cause for slowness.
> - Does the problem happen on a different printer also? With different
>   EPS files? Does commenting out the EPS improve the speed?

The problem happend in every PS printer I try.

> Anyway, I'm not a pro in PostScript yet and I haven't dealt with
> performance problems so I'm not a big help here. Maybe you could find
> some advice in a place dedicated to PostScript. If you find anything we
> would be glad to hear from you.
>
> Have you tried to use SVG instead of EPS?

I try that but I got two kinds of issue :
- I am not able to take care of the bounding box I defined in the EPS ... I 
don't know if it is an EPS to SVG problem or a Batik problem. I use 
"pstoedit" to convert. Have you another suggestion ?
- It seems that batik transform the SVG vectors to a bitmap image so I lost 
quality. Is there a way to transform batik directly to PDF drawing dirrective 
?
 
> I hope this helps a bit.

Yes it's help a bit ! Thanks !
I continued to investigate and another track could be the fact that my EPS 
graphics are encapsulated into several fo:table (fo:table within an 
fo:table-cell) ... During fo:table to PDF generation is there some heavy code 
generated ? (scaling ?)

>
> Jeremias Maerki

Olivier Imbert.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Rendering PDF with EPS graphics in it

Posted by Jeremias Maerki <de...@greenmail.ch>.
On 25.04.2003 18:30:58 Olivier Imbert wrote:
> Hi all,
> I sent the mail hereafter on the user list but nobody answer so I send it here 
> ...
> 
>  I have to render PDF including EPS graphics.
>  Everything renders fine using FOP 0.20.4.
>  I got a performance issue when printing on a PostScript printer  (several
>  types used) thru Acrobat Reader : for each page including EPS graphics the
>  printer spend a lot of time (formatting ?) before printing.
>  Printing an equivalent document from WordPerfect to the postscript printer
>  works fine.
>  Any idea ? Is there anything I can tune in the way FOP encapsulate EPS in
>  PDF ?
> 
> One thing I cannot understand is why fop insert a "scale" command before the 
> eps content and why this scale command is linked to the bounding box of the 
> eps ... The scale parameter seem very small also ...

I did not write the EPS wrapper but I believe the scale parameter is
basically so small (around 1/1000) because FOP works with millipoints
internally while PostScript/EPS works with points (1pt = 1000
millipoints) initially.

> For the same EPS file I got the fop following generation :

<snip what="Two PostScript wrappers for EPS files"/>

> Any idea or suggestion will be welcome ...

Unfortunately, I don't have access to a PostScript printer ATM so I
could test myself. But you could try the following to circle in possible
causes:
- Create a PostScript file from the PDF by printing to a file instead of
  to the printer.
- Edit the PostScript file and play with the code by commenting out one
  or more lines containing the "scale", "transform" etc. to see if the
  processing speed changes (even though the output won't be good
  anymore).
- The rest of the wrapper code doesn't look all that different but fact
  is that quite some data has to be pushed on the stack. This might be
  possible cause for slowness.
- Does the problem happen on a different printer also? With different
  EPS files? Does commenting out the EPS improve the speed?

Anyway, I'm not a pro in PostScript yet and I haven't dealt with
performance problems so I'm not a big help here. Maybe you could find
some advice in a place dedicated to PostScript. If you find anything we
would be glad to hear from you.

Have you tried to use SVG instead of EPS?

I hope this helps a bit.

Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org