Much appreciate your response.
I wasn't actually aware that I was using the Level 3
functionality of jpeg2ps - I would hardly consider
myself to be any kind of ps expert :). I have attached the header
from the ps file generated by jpeg2ps. Looks like the Level is
actually 2 though I am not sure.

As an aside, I noticed, much to my very pleasant surprise, that
simply by changing the "java2dlogo.gif" to "myfile.png" I could
get a png->ps conversion too. Very helpful for my Java3D
application where I have to necessarily get a png/gif/jpeg
output first before converting to ps. In that context,
is it possible to get a direct ps dump from a Java 2D
graphics JPanel ?

Thanks for your help

Vaidya

=========================================================================
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: jpeg2ps V1.9 by Thomas Merz
%%Title: nesrin.jpg
%%CreationDate: Thu Feb 20 01:14:18 2003
%%BoundingBox: 20 20 575 388
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%EndComments
%%BeginProlog
%%EndProlog
%%Page: 1 1
/languagelevel where {pop languagelevel 2 lt}{true} ifelse {
  (JPEG file 'nesrin.jpg' needs PostScript Level 2!\n) dup print flush
  /Helvetica findfont 20 scalefont setfont 100 100 moveto show showpage stop
} if
save
/RawData currentfile /ASCII85Decode filter def
/Data RawData << >> /DCTDecode filter def

============================================================================

>On Wed, 19 Feb 2003 11:05:58 -0800, Phil Race <[EMAIL PROTECTED]> wrote:

>Perhaps you are using the Level 3 postscript functionality of jpeg2ps
>
>It can embed the JPEG file directly.
>
>JDK needs to be able to print on Level 2 postscript printers.
>
>The only useful compression available for JPEG in level 2 is
>the patent encumbered LZW
>
>-phil.
>
>> Date: Wed, 19 Feb 2003 11:40:26 -0700
>> From: "N. Vaidya" <[EMAIL PROTECTED]>
>> Subject: [JAVA2D] JPEG to Postscript (JPS ???)
>> To: [EMAIL PROTECTED]
>>
>> Hopefully my question below is appropriate to this
>> Forum. If it is not, my apologies.
>>
>> What I am trying to do is to convert a jpeg file
>> to Postscript using the PrintGIFtoStream.java file
>> available at
>>
>> http://java.sun.com/j2se/1.4.1/docs/guide/jps/spec/JPSTOC.fm.html
>>
>> which is an online version of the Java Print Service API User Guide.
>>
>> I changed the DocFlavor.INPUT_STREAM.GIF specification to
>> DocFlavor.INPUT_STREAM.JPEG and changed "java2dlogo.gif" to
>> "myjpegfile.jpg". Compiling and running this code I got
>> a "newfile.ps" as the output. This was just great since I
>> wasn't aware that getting a postscript dump was so
>> easy in Java 1.4.
>>
>> However, when I compared the resulting postscript file size
>> from Java to that produced by the public domain utility
>> jpeg2ps, I was a little intrigued to note that the
>> Java output was much larger. Any particular reason why this
>> should be so ?
>>
>> As a testcase I used the nesrin.jpg file available as part of
>> the jpeg2ps distribution and compared the resulting postscript
>> file sizes. The stats are as below:
>>
>> jpeg2ps   49 kb
>> Java      1.4 Mb (uncompressed) & 931 Kb (gzipped)
>>
>> Is this expected or am I missing any fine tuning parameters ?
>>
>> Any help will be appreciated.
>>
>> Regards
>>
>> Vaidya
>>
>> ===========================================================================
>> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>> of the message "signoff JAVA2D-INTEREST".  For general help, send email to
>> [EMAIL PROTECTED] and include in the body of the message "help".
>
> ==========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff JAVA2D-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to