Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Using script to print out a html file

by Anonymous Monk
on Jul 31, 2000 at 07:28 UTC ( [id://25201]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am not sure whether its possible.
The script i want to create is one that is able to print
the html file, not the source code but the output i will
see on my browser.

Thanks.

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: Using script to print out a html file
by ColtsFoot (Chaplain) on Jul 31, 2000 at 12:40 UTC
    If you just want yo see the text that is contained
    in your HTML then you could try parsing your document
    using HTML::Parser
    $p = HTML::Parser->new(); $p->parse_file('Your_html.html');
    and then use HTML::FormattedText and the format method to
    get your output. Hope this is of help
Re: Using script to print out a html file
by Corion (Patriarch) on Jul 31, 2000 at 12:29 UTC

    It is in general a quite hard task to render HTML like "your" browser, as many browsers have quite different opinions on how to "correctly" render HTML. There are modules that do this for Perl, like HTML::Format, that can produce Postscript or ASCII text from HTML source, but if you want something in the quality of IE 5, supporting frames etc., you have to use IE 5 to print it.

    In general, Perl is the wrong hammer for this nail.

Re: Using script to print out a html file
by Anonymous Monk on Nov 29, 2002 at 12:11 UTC
    <HTML> <HEAD> <TITLE>UNIX Shell Scripts for Commonly Used fmbatch Commands - Support Knowledgebase</TITLE> <STYLE> body { background-color: white } </STYLE> <LINK REL="stylesheet" HREF="/ssi/css/win_ie.css"> <SCRIPT LANGUAGE="JavaScript"> </SCRIPT> <META name="title" content="UNIX Shell Scripts for Commonly Used fmbatch Commands"> <META name="docID" content="317072"> <META name="product" content="FrameMaker"> <META name="platform" content="UNIX"> <META name="version" content="5.x"> <META name="description" content="08/13/2001 - You can use fmbatch to open, print, reformat, and save Adobe FrameMaker d ocument s without actually displaying them. You can issue commands one at a time (i"> <META name="keywords" content="317072, FrameMaker, UNIX, batch macro"> </HEAD> <BODY LINK="#cc0000" ALINK="#cc0000" VLINK="#996666" MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0">
    <IMG SRC="/images/adobelogo.gif" WIDTH="115" HEIGHT="80" BORDER="0" ALT="Adobe">
    <IMG SRC="/images/nav/us_supportMainNav.gif" WIDTH="405" HEIGHT="48" USEMAP="#us_supportMainNavMap" BORDER="0" ALT="">
     
    <IMG SRC="/images/nav/store/us_storeProfileStatus_none.gif" WIDTH="230" HEIGHT="20" BORDER="0" USEMAP="#us_storeProfileStatus_noneMap">
    <MAP NAME="us_storeProfileStatus_noneMap"><AREA SHAPE="rect" ALT="Search" COORDS="82,1,126,15" HREF="/search/main.html"><AREA SHAPE="rect" ALT="Contact us" COORDS="134,2,199,15" HREF="/misc/comments.html"><AREA SHAPE="rect" ALT="Check out cart" COORDS="207,2,227,16" HREF="/store/checkout/cart.jhtml"></MAP>
    <IMG SRC="/images/nav/us_supportSubNav.gif" WIDTH="635" HEIGHT="32" USEMAP="#us_supportSubNavMap" BORDER="0" ALT="">
    <MAP NAME="us_supportMainNavMap"><AREA SHAPE="rect" ALT="Products" COORDS="13,29,75,43" HREF="/products/main.html"><AREA SHAPE="rect" ALT="Support" COORDS="100,29,160,44" HREF="/support/main.html"><AREA SHAPE="rect" ALT="Purchase" COORDS="182,27,249,44" HREF="/store/main.jhtml"><AREA SHAPE="rect" ALT="Company info" COORDS="275,27,367,44" HREF="/aboutadobe/main.html"></MAP> <MAP NAME="us_supportSubNavMap"><AREA SHAPE="rect" ALT="Downloads" COORDS="102,1,165,14" HREF="/support/downloads/main.html"><AREA SHAPE="rect" ALT="Training" COORDS="175,2,224,13" HREF="/misc/training.html"><AREA SHAPE="rect" ALT="Forums" COORDS="234,1,280,14" HREF="/support/forums/main.html"><AREA SHAPE="rect" ALT="Announcements" COORDS="290,1,387,13" HREF="/support/emaillist.html"><AREA SHAPE="rect" ALT="Survey" COORDS="398,2,443,14" HREF="http://survey.ccsurvey.com/adob0102ai/survey1.pl"></MAP>
    <IMG src="/support/images/small.gif" width=10 height=1 border=0> <IMG SRC="/support/images/supportknowledgebase.gif" WIDTH="500" HEIGHT="40" BORDER="0" ALT="Support Knowledgebase">
     
    Support Knowledgebase
    <IMG SRC="/support/images/arrow.gif" ALT="" WIDTH="10" HEIGHT="10" BORDER="0"> Document 317072
    <SPACER TYPE="BLOCK" HEIGHT="10" WIDTH="1">
    <SPACER TYPE="BLOCK" HEIGHT="10" WIDTH="1">
    Help With Searching


    <SCRIPT LANGUAGE="JavaScript"> </SCRIPT><FORM METHOD="POST" ACTION="http://survey.ccsurvey.com/adob0102ai/survey7.pl"><INPUT TYPE="hidden" NAME="URL" VALUE="/support/techdocs/1242e.htm"><INPUT TYPE="hidden" NAME="Title" VALUE="UNIX Shell Scripts for Commonly Used fmbatch Commands"><INPUT TYPE="hidden" NAME="DocID" VALUE="317072"><INPUT TYPE="hidden" NAME="Product" VALUE="FrameMaker"><INPUT TYPE="hidden" NAME="Platform" VALUE="UNIX"><INPUT TYPE="hidden" NAME="Version" VALUE="5.x"><INPUT TYPE="hidden" NAME="LastEdited" VALUE="08/13/2001"><INPUT TYPE="hidden" NAME="Ftype" VALUE="TSDB"><NOSCRIPT><INPUT TYPE="IMAGE" SRC="/support/images/gotsometime.gif" WIDTH="120" HEIGHT="65" BORDER="0" ALT="Got Some Time to Take a Survey?">
    Tell us what you think about this document.</NOSCRIPT></FORM>

    Product
    FrameMaker

    Platform
    UNIX

    Last Edited
    08/13/2001

    Filename
    1242e.htm

      UNIX Shell Scripts for Commonly Used fmbatch Commands

    You can use fmbatch to open, print, reformat, and save Adobe FrameMaker documents without actually displaying them. You can issue commands one at a time (interactively), or you can store commands in a text file (i.e., a batch file) and issue all the commands in a single command. For example, the following batch file contains a sequence of commands that will open FileA, save FileA in MIF format, then close FileA and perform the same operation on FileB.

    Open FileA
    SaveAs m FileA FileA.mif
    Quit FileA
    Open FileB
    SaveAs m FileB FileB.mif
    Quit FileB

    After creating a batch file, you run fmbatch from a UNIX command line using the batch file name as an argument:

    fmbatch batchfile

    The following UNIX shell scripts create batch files you can use with the fmbatch command.

    - This script builds a batch file that saves all documents in the present working directory in MIF format. Saving in MIF format is useful when it is necessary to open documents in an earlier version of FrameMaker.

    #! /bin/csh -f
    # C shell script to build an fmbatch command file that
    # saves all documents in the current directory as mif files.

    set scriptname = createbatch
    set batchfile = commands.batch
    rm -f $batchfile >& /dev/null
    touch $batchfile
    foreach f ( * )
    # don't add directories or the batch file
    if ( ! -d "$f" && "$f" != "$batchfile" ) then
    echo "Open $f" >> $batchfile
    echo "echo Saving $f to $f.mif" >> $batchfile
    echo "SaveAs m $f $f.mif" >> $batchfile
    echo "Quit $f" >> $batchfile
    endif
    end
    echo ""
    echo "$scriptname is done. See batchfile in $batchfile."

    - This script builds a batch file that saves all documents in the present working directory. It is useful after you've upgraded to a later version of FrameMaker as it circumvents the alert message you would get when opening and saving documents interactively.

    #! /bin/csh -f
    # C shell script to build an fmbatch command file that opens
    # and saves all documents in the current directory.

    set scriptname = createbatch
    set batchfile = commands.batch
    rm -f $batchfile >& /dev/null
    touch $batchfile
    foreach f ( * )
    # don't add directories or the batch file
    if ( ! -d "$f" && "$f" != "$batchfile" ) then
    echo "Open $f" >> $batchfile
    echo "echo Saving $f" >> $batchfile
    echo "Save $f" >> $batchfile
    echo "Quit $f" >> $batchfile
    endif
    end
    echo ""
    echo "$scriptname is done. See batchfile in $batchfile."

    - This script prints all documents in the present working directory. It assumes you have print settings file named "SetFile" specified. A print settings file is a FrameMaker document that has been saved with the desired print settings configured in the Print dialog box. If a print settings file is not specified, the print settings of individual the documents will be used when printing. However, a print settings file is very useful when it is desirable to print to a PostScript or PDF file.

    #! /bin/csh -f
    # C shell script to build an fmbatch command file that opens
    # and prints all documents in the current directory.

    set scriptname = createbatch
    set batchfile = commands.batch
    rm -f $batchfile >& /dev/null
    touch $batchfile
    foreach f ( * )
    # don't add directories or the batch file
    if ( ! -d "$f" && "$f" != "$batchfile" ) then
    echo "Open $f" >> $batchfile
    echo "echo Printing $f" >> $batchfile
    echo "Print $f SetFile" >> $batchfile
    echo "Quit $f" >> $batchfile
    endif
    end
    echo ""
    echo "$scriptname is done. See batchfile in $batchfile."


    Related Records

      <SPACER TYPE="BLOCK" HEIGHT="1" WIDTH="1">  

      <IMG SRC="/images/backtotop.gif" WIDTH="59" HEIGHT="13" BORDER="0" ALT="Back To Top">      
    Copyright ©2002 Adobe Systems Incorporated. All rights reserved.
    Information is provided "As Is" without warranty of any kind. Users may make a
    single copy of portions of knowledgebase for personal use provided that this notice is
    included on such copy.
    See Terms of Use for additional terms for use.
    Online Privacy Policy
    Adobe and accessibility
    Avoid Software Piracy

    </BODY></HTML>

    Originally posted as a Categorized Answer.

Re: Using script to print out a html file
by Anonymous Monk on Dec 06, 2002 at 16:43 UTC
    asdfasdf

    Originally posted as a Categorized Answer.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://25201]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-16 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found