HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: postscript attachments show up at 5% size



Hello,

On Wed, Oct 29, 1997 at 11:04:51AM -0300, Ben Parker wrote:
> It's possible to send attachments through faxmail but you have to put in a
> couple of scripts for each mime type (ie image/gif). One to convert (ie
> GIF to PS), and one to massage the resulting output to compensate for
> faxmail trying to squash the image in 1/20 th original size in the bottom
> left corner.  Sending PS files is ironically the hardest battle. I have
> discovered a silly workaroud. If you attach the PS file twice you get a
> thumbnail on Page 1 and a full size version on Page 2. Pretty punishing on
> transmit time, though.

I'm running hylafax-v4.0pl1 on a Linux 2.0.29 system.
I have that atatchment problem too, and after some investigation,
I found the following:

For an email-message like this:

>  To: x999
>  From <lrei@ictlux.com>
>  Subject: test

  The quick brown fox...

faxmail produces a PS output like this:

  %!PS-Adobe-3.0
  %%Creator: HylaFAX TextFmt Class
  %%Title: HylaFAX-Mail
[...snip...]
  %       $Id: faxmail.c++,v 1.56 1996/07/02 19:49:58 sam Exp sam
  %
  % faxmail prologue.
  %
  /EPSbegin{save gsave 20 20 scale 200 dict begin}def
  /EPSend{end grestore restore}def
  end
  %%EndProlog
  %%Page: "1" 1
  save $printdict begin
  .05 dup scale
   sf0 ()[()()](1)Header
  360 16092 moveto
  B(To:)s1  570 M (x999)s2 EL
  B(Subject:)s1  94 M (test)s2 EL
  B EL
  B(The quick brown fox...)S

  showpage
  end restore
  %%Trailer
  %%Pages: 1
  %%EOF

Please pay attention to the `.05 dup scale' and the last 5 lines.

Now I take an email message like this:

>  To: x999
>  From <lrei@ictlux.com>
>  Subject: test
>  MIME-Version: 1.0
>  Content-Type: multipart/mixed; boundary="------------6285531E7FBD"
>
>  This is a multi-part message in MIME format.
>
>  --------------6285531E7FBD
>  Content-Type: text/plain; charset=us-ascii
>  Content-Transfer-Encoding: 7bit
>
>  http://www.w3.org/ 
>
>  --------------6285531E7FBD
>  Content-Type: text/html; charset=us-ascii
>  Content-Transfer-Encoding: 7bit
>  Content-Base: "http://www.w3.org/"
>
>  <BASE HREF="http://www.w3.org/">
>
>  <HTML><HEAD>
>[...snip...]
>  </HTML>
>
>  --------------6285531E7FBD--

and faxmail produces this PS:

  %!PS-Adobe-3.0
  %%Creator: HylaFAX TextFmt Class
  %%Title: HylaFAX-Mail
[...snip...]
  %       $Id: faxmail.c++,v 1.56 1996/07/02 19:49:58 sam Exp sam
  %
  % faxmail prologue.
  %
  /EPSbegin{save gsave 20 20 scale 200 dict begin}def
  /EPSend{end grestore restore}def
  end
  %%EndProlog
  %%Page: "1" 1
  save $printdict begin
  .05 dup scale
   sf0 ()[()()](1)Header
  360 16092 moveto
  B(To:)s1  570 M (x999)s2 EL
  B(From:)s1  316 M (<lrei@incotech.lu>)s2 EL
  B(Subject:)s1  94 M (test)s2 EL
  B EL
  B(http://www.w3.org/)S
  B()S
  %!
  %%Title: W3
  %%Creator: html2ps version 1.0 beta1
  %%CreationDate: Thu Oct 30 12:54:21 1997
[...snip...]
  end restore

  showpage
  end restore
  %%Trailer
  %%Pages: 1
  %%EOF

Again, pay attention to the `.05 dup scale', the last 5 lines AND the
position where the output of the text/html MIME-converter-script
(using html2ps in my case) has been inserted.

As far as I can see, the output from the converter-script has
not been appended to the PS generated from the first part of the
multipart MIME message, but inserted before the `showpage'
`end restore' of that first page. The result of this is, that
the `.05 dup scale' is still in effect when the converter output
gets interpreted. This results in the small "thumbnail" on the
first page that a few of you have described.

Also, this explains why the "double attachments" described by
Ben Parker work. The first attachment gets scaled down because
of the reason descibed above. This first attachment supposedly
ends with `showpage' and `end restore' which put the effect of
`.05 dup scale' to an end, and then his second attachment gets
faxed OK.

I have manually moved those last five lines so that they precede
the start `%!' of the converter-script output and then the fax
just looks fine.

As it appears to me, the problem is situated in faxmail or the
TextFmt routines used by faxmail. Due to my lack of c/c++
programming skills, I have not been able to hack the source
to get this solved.

Hope this helps.
Louis
-- 
   Louis REINARD - LX 1 QA
   At work: lrei@ictlux.com , PGP KeyID: 1024/0xEB16815D
   At home: lou@ictlux.com  , PGP KeyID: 1024/0x1F5F4EFD
   To get PGP public keys, email with Subject: SENDPGPKEY

   Misfortune: (n), a fortune that never misses.
                -- Ambrose Bierce, The devil's dictionary





Project hosted by iFAX Solutions