Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I've done a bit of preliminary research, but I figured I'd request confirmation before I go waste a ream...

I need to print the websites bookmarked in a particular folder of my firefox bookmarks. Netscape::Bookmarks seems to be able to parse the bookmarks, but I'm having trouble finding an apt printing module. Ideally I'd like to be able to do something like the following:

PrintURI("http://somesite.tld/page.html");

At this point I should note that I have access to both Windows and Linux, but the printer is currently hooked up to the Windows box. My research thus far has been with regard to printing on Windows, but Linux alternatives are welcome as well.

  • Win32::Printer::Direct will print a file, but a URI? I imagine I could rig an LWP::Simple to create a stream; however I'd like to print the website, not the raw HTML, et all.
  • Printer is cross platform, but seems a bit more raw

I did find a few other modules as well, but I guess the real question is how to print a website as a browser renders, as opposed to the raw HTML?

UPDATE: LWP::Simple::getprint($url) and LWP::Simple::getstore($file) appear to offer the functionality I was looking for. While using getstore($file) appears simple enough, how would I use getprint($url) and print the resultant stream?

UPDATE: LWP::Simple merely solves the problem of obtaining a stream; however I have yet to figure out how to render HTML and send the rendered stream to the printer...

UPDATE: Thanks to Re: Win32::OLE printing I managed to figure out how to get Internet Explorer to print without intervention; however I still can't figure out how to get the URLs from my bookmarks list. Netscape::Bookmarks::Category seemed promising, but I can't figure out how to change from the root category to the one I want. URI::Bookmarks::tree_root() appears to be able to change the root to a folder -- but I can't seem to figure out how to represent that folder as a "node"...


In reply to Print Bookmarked Webpages by eibwen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-03-19 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found