For Programmers: Free Programming Magazines  


Home > Archive > PostScript > February 2006 > Convert EPS to PDF without transcoding the inline JPEG









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Convert EPS to PDF without transcoding the inline JPEG
Andre Dierker

2006-02-24, 7:57 am

Hi all!

I have a bunch of EPS-files that contain no vector data but bitmaps
compressed with JPEG. I want to convert these to PDF. Since PDF is also
able to include JPEG I thought there has to be a way to transfer the JPEG
into the new PDF-Container without having the image reencoded as JPEG.

I've tried epstopdf (which relies on ps2pdf from ghostscript) but it seems
to do the job the following way:
- render the EPS in its native resolution
- get the resulting bitmap
- encode the bitmap as JPEG
- wrap the JPEG in PDF

The JPEG is decoded and immediately reencoded and there is a loss of quality
due to added compression artefacts.

Surprizingly there are no artefacts if I use the JPGE-device of ghostscript
to convert the EPS to JPEG. Unfortunately I cannot use e.g. iText to create
a new PDF with this JPEG-file: there are clippings paths in the EPS-files
that are very important. So I have to find a solution with a direct
conversion.

I've searched with google and the keywords 'eps pdf jpg jpeg without
transcode transcoding' in various combinations and found 'epstopdf-fixjpg'
by Heiko Purnhagen which seems to address the topic, but it doesn't find
the JPEG in my EPS:

~/test/Problem$ epstopdf Test.eps --outfile=epstopdf.pdf
~/test/Problem$ epstopdf-fixjpg epstopdf.pdf Test.eps > fixjpg.pdf
epstopdf-fixjpg: jpg0: 0
epstopdf-fixjpg: no jpg found
~/test/Problem$

I've also tried pstoedit but that resulted in an empty PDF:

~/test/Problem$ pstoedit -f pdf Test.eps pstoedit.pdf
pstoedit: version 3.33 / DLL interface 108 (build Jul 29 2004 - release
build) : Copyright (C) 1993 - 2003 Wolfgang Glunz
Warning: Level 2 version of image and imagemask not supported for this
backend (due to lack of support for FILE files)
Interpreter finished. Return status 0
~/test/Problem$

The same problem with pstill:

~/test/Problem$ pstill -2 -o pstill.pdf Test.eps
WARNING: Base font 'Courier' missing, turn on option -v for details
PStill[tm] - PS/EPS to PDF Converter by Frank Siegert
* This version may be used freely for private and educational purposes
* Commercial users must apply for a license, see enclosed documentation
* Please setup the license environment variable to remove this message
An error occured during conversion, turn on verbose ('-v') for details
~/test/Problem$

With '-v' I get
* PStill Interpreter concluded, 1 pages, status Error 2, vmstat 3243.2 kByte
The interpretation produced the following messages:
PS-Messages> * PStill is interpreting /home/adierker/test/Problem/Test.eps
PS-Messages> PostScript Error: undefined, Command L2_eDM
PS-Messages> Error near file position: 524
PS-Messages> false
PS-Messages> -marktype-
PS-Messages> -filetype-
PS-Messages> /Data
PS-Messages> -savetype-
PS-Messages> PostScript Error: undefined, Command pst_callEndPage
PS-Messages> Error near file position: 524
PS-Messages> false
PS-Messages> false
PS-Messages> -marktype-
PS-Messages> -filetype-
PS-Messages> /Data
PS-Messages> -savetype-
- End of messages -

I've uploaded the Test.eps and all resulting files to
http://www.kand.de/gs/

Where is my mistake or are there any other tools I could try?

Andre
Carsten Hammer

2006-02-24, 6:59 pm

Hi Andre,
if you have more time to spend on the problem it might be an option to
try to add the missing postscript commands to itext´s postscript
interpreter.
Best regards,
Carsten

Andre Dierker schrieb:
> Hi all!
>
> I have a bunch of EPS-files that contain no vector data but bitmaps
> compressed with JPEG. I want to convert these to PDF. Since PDF is also
> able to include JPEG I thought there has to be a way to transfer the JPEG
> into the new PDF-Container without having the image reencoded as JPEG.
>
> I've tried epstopdf (which relies on ps2pdf from ghostscript) but it seems
> to do the job the following way:
> - render the EPS in its native resolution
> - get the resulting bitmap
> - encode the bitmap as JPEG
> - wrap the JPEG in PDF
>
> The JPEG is decoded and immediately reencoded and there is a loss of quality
> due to added compression artefacts.
>
> Surprizingly there are no artefacts if I use the JPGE-device of ghostscript
> to convert the EPS to JPEG. Unfortunately I cannot use e.g. iText to create
> a new PDF with this JPEG-file: there are clippings paths in the EPS-files
> that are very important. So I have to find a solution with a direct
> conversion.
>
> I've searched with google and the keywords 'eps pdf jpg jpeg without
> transcode transcoding' in various combinations and found 'epstopdf-fixjpg'
> by Heiko Purnhagen which seems to address the topic, but it doesn't find
> the JPEG in my EPS:
>
> ~/test/Problem$ epstopdf Test.eps --outfile=epstopdf.pdf
> ~/test/Problem$ epstopdf-fixjpg epstopdf.pdf Test.eps > fixjpg.pdf
> epstopdf-fixjpg: jpg0: 0
> epstopdf-fixjpg: no jpg found
> ~/test/Problem$
>
> I've also tried pstoedit but that resulted in an empty PDF:
>
> ~/test/Problem$ pstoedit -f pdf Test.eps pstoedit.pdf
> pstoedit: version 3.33 / DLL interface 108 (build Jul 29 2004 - release
> build) : Copyright (C) 1993 - 2003 Wolfgang Glunz
> Warning: Level 2 version of image and imagemask not supported for this
> backend (due to lack of support for FILE files)
> Interpreter finished. Return status 0
> ~/test/Problem$
>
> The same problem with pstill:
>
> ~/test/Problem$ pstill -2 -o pstill.pdf Test.eps
> WARNING: Base font 'Courier' missing, turn on option -v for details
> PStill[tm] - PS/EPS to PDF Converter by Frank Siegert
> * This version may be used freely for private and educational purposes
> * Commercial users must apply for a license, see enclosed documentation
> * Please setup the license environment variable to remove this message
> An error occured during conversion, turn on verbose ('-v') for details
> ~/test/Problem$
>
> With '-v' I get
> * PStill Interpreter concluded, 1 pages, status Error 2, vmstat 3243.2 kByte
> The interpretation produced the following messages:
> PS-Messages> * PStill is interpreting /home/adierker/test/Problem/Test.eps
> PS-Messages> PostScript Error: undefined, Command L2_eDM
> PS-Messages> Error near file position: 524
> PS-Messages> false
> PS-Messages> -marktype-
> PS-Messages> -filetype-
> PS-Messages> /Data
> PS-Messages> -savetype-
> PS-Messages> PostScript Error: undefined, Command pst_callEndPage
> PS-Messages> Error near file position: 524
> PS-Messages> false
> PS-Messages> false
> PS-Messages> -marktype-
> PS-Messages> -filetype-
> PS-Messages> /Data
> PS-Messages> -savetype-
> - End of messages -
>
> I've uploaded the Test.eps and all resulting files to
> http://www.kand.de/gs/
>
> Where is my mistake or are there any other tools I could try?
>
> Andre

bugbear

2006-02-27, 7:56 am

Andre Dierker wrote:
> Hi all!
>
> I have a bunch of EPS-files that contain no vector data but bitmaps
> compressed with JPEG. I want to convert these to PDF. Since PDF is also
> able to include JPEG I thought there has to be a way to transfer the JPEG
> into the new PDF-Container without having the image reencoded as JPEG.


You want this:
http://groups.google.com/group/comp...7c53fc8783b2a3a

A distiller option:

"It's PassThroughJPEGImages. According to the section "Changes Since
Last Revsion", this was introduced with Distiller 6."

BugBear
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com