Can anyone suggest an #ifdef or ./configure test for whether to use
"w" or "wb" as the second argument to fopen() in htdig/ExternalParser.cc?
The fopen man page on my system says the b is allowed for ANSI C compliance,
but I'm a little concerned that if I just add it unconditionally, it will
break on some systems. Any thoughts as to how I should make sure the b
is added for systems where it's needed (e.g. Cygwin, Win32), and not on
systems where it would break fopen()?
Thanks.
--- begin forwarded message from =?iso-8859-1?Q?St=E9phane_Baudet?= ---
From: =?iso-8859-1?Q?St=E9phane_Baudet?= <[EMAIL PROTECTED]>
To: "Gilles Detillieux" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Subject: RE: [htdig] parsing PDF with NT
Date: Wed, 1 Mar 2000 18:23:38 +0100
Yess it works now !! I just added "wb" as the second argument, then
recompiled htdig. And now it works perfectly ! HtDig retrieves the correct
size for temporary files and all works well in the best world !
To parse the PDF files, I used conv_doc.pl with the following line in
htdig.conf :
external_parsers: application/pdf->text/html "d:/perl/bin/perl.exe
/opt/www/htdig/bin/conv_doc.pl"
But it should work also with parse_doc.pl I think.
Thank you for your help, you're great ;)
See Ya !
Stephane Baudet.
-----Message d'origine-----
De : Gilles Detillieux [mailto:[EMAIL PROTECTED]]
Envoy� : mercredi, mars 01, 2000 6:01 PM
� : St�phane Baudet
Cc : [EMAIL PROTECTED]
Objet : Re: [htdig] parsing PDF with NT
According to =?iso-8859-1?Q?St=E9phane_Baudet?=:
> Well thanks for your reply. I upgraded to 3.1.5, but I still have problems
> parsing PDF files. I found that the temporary files retrieved by HtDig are
a
> little bigger than the original PDF files. I managed to keep it and tried
to
> open it with Acrobat reader. And actually, pages remain blank, so the file
> should be corrupted.
> For example, I have a PDF which size is 90076 bytes and HtDig retrieves a
> temporary file in /tmp which size is 90386 bytes !!
> Any idea ?
Well, I'm going out on a limb here, because I'm really not familiar with
the Cygwin package, but if it makes a distinction between writing to
binary files vs. text files, adding CRs before LFs on text files, then this
could be the problem here. htdig/ExternalParser.cc creates its temporary
file using:
FILE *fl = fopen(path, "w");
If this causes the Cygwin library to do CR/LF expansion, you'd need to
change this to avoid that problem, e.g. by using "wb" as the second
argument, if that's what it takes, or somehow setting O_BINARY mode on
the file. Have a look at the Cygwin docs, and please let us know if you
find a fix - we'll try to incorporate a portable form of it in future
releases.
--
Gilles R. Detillieux E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre WWW:
http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba Phone: (204)789-3766
Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930
------------------------------------
To unsubscribe from the htdig mailing list, send a message to
[EMAIL PROTECTED]
You will receive a message to confirm this.
--- end forwarded message from =?iso-8859-1?Q?St=E9phane_Baudet?= ---
--
Gilles R. Detillieux E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba Phone: (204)789-3766
Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930
------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED]
You will receive a message to confirm this.