Inter Program Communication ...

S

Stoill Barzakov

Slackware Linux + Konqueror

I've got an invoice shown on the Konqueror screen from some web/billing
frontend . I'ts mostly text fields and few submit buttons . I want to
collect info from Konqueror (it may include all the html content) and feed
It through already made Perl code to Fiscal Printer .

Direct print from Konqueror is not an option . The Fiscal Printer doesn't
accept standart pure text print . It has own language with CRC on every
command sent .

Is there a Perl module with capability to grab contents of the page shown in
Konqueror if I know Konqueror process ID ?
 
B

Ben Morrow

Quoth Stoill Barzakov said:
Slackware Linux + Konqueror

I've got an invoice shown on the Konqueror screen from some web/billing
frontend . I'ts mostly text fields and few submit buttons . I want to
collect info from Konqueror (it may include all the html content) and feed
It through already made Perl code to Fiscal Printer .

Direct print from Konqueror is not an option . The Fiscal Printer doesn't
accept standart pure text print . It has own language with CRC on every
command sent .

Is there a Perl module with capability to grab contents of the page shown in
Konqueror if I know Konqueror process ID ?

I doubt it... you would almost certainly need Perl XPCOM bindings, which
AFAIK haven't been written yet :). I am sort-of semi-considering looking
at it, but it looks to be *quite* a job.

At least in Moz/Firefox, you can set the 'printer' to be a pipe to any
process (which will receive postscript): can you not write a (or use a
pre-written) PS->Fiscal Printer converter there?

Ben
 
T

Tad McClellan

Stoill Barzakov said:
I've got an invoice shown on the Konqueror screen from some web/billing
frontend . I'ts mostly text fields and few submit buttons . I want to
collect info from Konqueror (it may include all the html content) and feed
It through already made Perl code to Fiscal Printer .

Is there a Perl module with capability to grab contents of the page shown in
Konqueror


What Konqueror shows are a bunch of pixels.

Are you wanting to get a screen shot?

if I know Konqueror process ID ?


No, but I don't think that is what you need.

You CAN grab the same page that you see in Konqueror if you
know the URL that you gave to Konqueror.

By the time Konqueror renders it on the screen it is already
Hamburger, too late to make Steak, so move a bit forward in
the flow of things before the HTML is ground up for rendering.

perldoc -q HTML

How do I fetch an HTML file?

How do I automate an HTML form submission?
 
L

Laura

Stoill said:
Slackware Linux + Konqueror

I've got an invoice shown on the Konqueror screen from some web/billing
frontend . I'ts mostly text fields and few submit buttons . I want to
collect info from Konqueror (it may include all the html content) and feed
It through already made Perl code to Fiscal Printer .

Direct print from Konqueror is not an option . The Fiscal Printer doesn't
accept standart pure text print . It has own language with CRC on every
command sent .

Is there a Perl module with capability to grab contents of the page shown
in Konqueror if I know Konqueror process ID ?

why not have the html form submit to a perl cgi program which will in turn
execute your 'already made perl code' with the appropriate data?
 
S

Stoill Barzakov

Tad McClellan wrote:

perldoc -q HTML

How do I fetch an HTML file?

How do I automate an HTML form submission?

I've already been through most of the *simple* docs . What I need is to get
Exactly what the current user is Konquering and IF it is Invoice screen
(I've got some marks that will define this) to grab the page from It and
process It . Bitmap will not do . I need pure text or pure html .
 
S

Stoill Barzakov

Ben said:
I doubt it... you would almost certainly need Perl XPCOM bindings, which
AFAIK haven't been written yet :). I am sort-of semi-considering looking
at it, but it looks to be *quite* a job.

At least in Moz/Firefox, you can set the 'printer' to be a pipe to any
process (which will receive postscript): can you not write a (or use a
pre-written) PS->Fiscal Printer converter there?

Ben

This could work :-| but Mozilla haz a really mean Cyrillic support . It's
not even little WYSIWYG, an if I see cyrillic on screen when I print It's
all boxes instead of chars :-/ therefore It will just eat my time writting
a filter .

.... anyway, is there a way to get ONLY the url currently Konquered by user ?
If I can fetch It from the browser, a conversion and print can be
arranged .
 
S

Stoill Barzakov

<posted & mailed>
why not have the html form submit to a perl cgi program which will in turn
execute your 'already made perl code' with the appropriate data?

I CAN'T touch the server :( I can only work from billing/client side . And
sorry to say - never wrote good cgi script myself .
 
E

Eric Bohlman

I've already been through most of the *simple* docs . What I need is
to get Exactly what the current user is Konquering and IF it is
Invoice screen (I've got some marks that will define this) to grab the
page from It and process It . Bitmap will not do . I need pure text
or pure html .

One possibility would be to set your program up to as a "local proxy
server". You'd tell Konqueror (or any other browser) to connect to it
(locally) as a proxy, and it would simply transparently pass on any
requests to the real server and serve the response to the browser. But it
would also examine the response and, if appropriate (e.g. the response has
a content-type of "text/html"), store it.

Look in the "HTTP" section of CPAN for modules with "proxy" in their names.
For that matter, you could probably cobble up something from LWP::UserAgent
and HTTP::Daemon pretty quickly (since HTTP::Daemon will get HTTP::Request
objects, which you can pass on directly to LWP::UserAgent, from the browser
and can send HTTP::Response objects obtained from LWP::UserAgent to the
browser).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,432
Latest member
GTRNorbert

Latest Threads

Top