Loading ...
Sorry, an error occurred while loading the content.
 

Re: [PBML] word to html

Expand Messages
  • Cam Coble
    What s wrong with saving the document as html in word, then uploading? This way you can tell what will happen to the document, as converting to html from Word
    Message 1 of 8 , Nov 1, 2001
      What's wrong with saving the document as html in word, then uploading?
      This way you can tell what will happen to the document, as converting to html
      from Word is no small task. A lot of the formatting is lost, as well as
      layout control.


      --
      Cam Coble
    • Oliver Manickum
      I have done this in vb ... made an exe of the application and use perl to control it.... source code of the vb app is here Dim oWord As New Word.Application
      Message 2 of 8 , Nov 1, 2001
        I have done this in vb ... made an exe of the application and use perl
        to control it....

        source code of the vb app is here

        Dim oWord As New Word.Application
        Dim oDoc As Document

        Set oDoc = oWord.Documents.Open(file.text)
        oDoc.SaveAs "C:\temp\Report.html", fileformat:=wdFormatHTML
        oDoc.Close
        oWord.quit



        u can use the Win32::API to do this also ...

        - Olly


        -----Original Message-----
        From: Cam Coble [mailto:tech@...]
        Sent: Thursday, November 01, 2001 4:31 PM
        To: perl-beginner@yahoogroups.com
        Subject: Re: [PBML] word to html


        What's wrong with saving the document as html in word, then uploading?
        This way you can tell what will happen to the document, as converting to
        html
        from Word is no small task. A lot of the formatting is lost, as well as
        layout control.


        --
        Cam Coble



        Your use of Yahoo! Groups is subject to
        http://docs.yahoo.com/info/terms/
      • Peter Kirby
        ... I think your best bet is to see if Word s conversion utility can be invoked from the command line and to host your script on a NT machine. That s the only
        Message 3 of 8 , Nov 1, 2001
          At 09:30 AM 11/1/01 -0500, you wrote:
          >What's wrong with saving the document as html in word, then uploading?
          >This way you can tell what will happen to the document, as converting to html
          >from Word is no small task. A lot of the formatting is lost, as well as
          >layout control.

          I think your best bet is to see if Word's conversion utility can be invoked
          from the command line and to host your script on a NT machine. That's the
          only way I could imagine it working, as only Microsoft has the technology
          for converting Word to HTML.

          If Word cannot be invoked from the command line, try making a 32-bit
          Windows program that mimicks a person by opening Word and pressing all the
          right buttons. Then call that program from your Perl script.

          If there is an easier way, hopefully someone will let us know.

          best,
          Peter Kirby
        • Damien Carbery
          ... Shouldn t this line be: print $_; # or just: print; It looks like your script is trying to put a GIF file out as part of HTML output. Instead of the
          Message 4 of 8 , Nov 1, 2001
            > print <file>;
            Shouldn't this line be:
            print $_; # or just: print;

            It looks like your script is trying to put a GIF file out as part of
            HTML output.
            Instead of the flock/open/while stuff, use:
            <IMG SRC="$pic" ...width etc>

            Aside: Why are the GIF files in the CGI area and not under
            Document_Root?
            Are they NetFirms files?

            Damien.

            --- In perl-beginner@y..., gordonisnz@y... wrote:
            >
            > Hi there, Ive got one script which copies a file from a CGI sub-
            > directory - into the same directory /pics - But under a different
            > name..
            >
            > Anyway, im using the file-name, using the PATH_TRANSLATED variable,
            > to find the exact / true location of the file,
            > and using :-
            >
            > print "<IMG SRC=\"pics.cgi?pic=$pic\" WIDTH=\"$width\"
            > HEIGHT=\"$height\"><BR>$desc<BR>\n";
            >
            > These pictures are all GIF files - in the netfirms CGI (sub)
            directory
            >
            > See below...
            >
            > Another person suggested CHMOD the sub-directory to 644 ...
            > I tried that & it didnt work (I dont have a 'number' in my FTP
            > programme - Just the read/write/execute buttons etc..)
            >
            > I'll try swapping the clicks around -(wait til netfirms FTP is up &
            > running again)..
            >
            >
            > ------------------------
            >
            > #!/usr/bin/perl -w
            >
            > use CGI::Carp qw(fatalsToBrowser);
            > use CGI 'param';
            >
            >
            > my $pic = param 'pic';
            >
            >
            > print "Content-type: text/html\n\n";
            > print "<HTML>\n";
            > print "<BODY>\n";
            >
            >
            > print "PIC = '$pic'<BR>\n";
            >
            >
            > open (file,"$pic");
            > flock (file,1);
            > while (<file>) {
            > print <file>;
            > }
            > flock (file,8);
            > close file;
            >
            > print "<BR> PIC = '$pic'<BR>\n";
          • Greg
            You need to give owner read & write permissions group read everyone read plus, if the directory also contains cgi files, execute for all Greg
            Message 5 of 8 , Nov 2, 2001
              You need to give owner read & write permissions
              group read
              everyone read

              plus, if the directory also contains cgi files, execute for all

              Greg
              ==============================================================
              > --- In perl-beginner@y..., gordonisnz@y... wrote:
              > > Another person suggested CHMOD the sub-directory to 644 ...
              > > I tried that & it didnt work (I dont have a 'number' in my FTP
              > > programme - Just the read/write/execute buttons etc..)
              > >
            • gordon stewart
              ... print $_; # or just: print; It looks like your script is trying to put a GIF file out as part of HTML output. Instead of the flock/open/while stuff,
              Message 6 of 8 , Nov 2, 2001
                --- Damien Carbery <daymobrew@...> wrote:

                > print <file>;

                print $_; # or just: print;<BR>

                It looks like your script is trying to put a GIF file
                out as part of HTML output.

                Instead of the flock/open/while stuff, use:

                <IMG SRC="$pic"...width etc.. >

                >
                Aside: Why are the GIF files in the CGI area and not
                under Document_Root?

                Are they NetFirms files?
                <

                No - My friends "client" wants protected gif files..
                (im hoping to get referals & propper webv-work..)

                So basically, Ive got a cgi directory - Which contains
                the gif files..

                - My script copies & re-names them into a randomised
                name..

                & uses the 'stat' command to find the new names &
                deletes any gifs over 2-3 minutes old..

                I can copy & re-name things fine - into the /pics
                directory..

                However My script on Netfirms - Doesnt like the 'stat'
                command..

                I can get the list of files ok - In that directory -
                But if i use the stat command on each files - It
                returns blank values..

                Ive used $ENV{DOCUMENT_ROOT} & the URL approach etc..
                - no combinations work.

                On my own home server - It works fine...

                But the stat command works fine, on any files in the
                cgi directory...

                Any ideas - apart from the 'stat' command, I can get
                the number of seconds on a specific URL ?

                EG http://(whatever domain)/pics/gfrsfh.gif

                G.



                =====
                G. Stewart
                New Zealand chat & Discussion group email
                new_zealand-help@yahoogroups.com for details.

                http://briefcase.yahoo.com.au - Yahoo! Briefcase
                - Manage your files online.
              Your message has been successfully submitted and would be delivered to recipients shortly.