[ic] Generating .html files

Grant emailgrant at gmail.com
Sat Feb 2 20:35:12 EST 2008

> > > I currently print order receipts by accessing
> > > example.com/admin/receipt.html?mv_arg=1234 and printing through the
> > > browser, but I'm trying to set up an automated system that will print
> > > order receipts via Net::Printer.  I think I will need static .html
> > > files for that.  How would you guys create a static .html file from
> > an
> > > IC page?
> >
> > There are a few different ways, you can turn any ITL code into HTML
> > simply by interpolating it, for example:
> >
> > [seti bar]<a href="[area foo]">link to foo</a>[/seti]
> >
> > Will store the HTML link to the foo page in bar...
> >
> > [seti bar][include pages/foo.html][/seti]
> >
> > will store the full HTML for the foo Interchange page in the bar
> > scratch
> > (foo.html must be in your catalog's pages directory)...
> >
> > [my-printing-tag interpolate=1][include pages/foo.html][/my-printing-
> > tag]
> >
> > will call your specialized printing container tag with the contents of
> > the foo IC page interpolated to html in the body of the tag.  Your
> > printing tag can then do whatever it wats with the body (like print it
> > for example).
> >
> > Peter
> I'm not sure what Peter just said :-)
> We use capture_page:
> http://www.icdevgroup.org/docs/tags/capture_page.html
> Paul

To access the order receipt page I must be logged into the admin
interface though.  Will IC know it's OK to allow capture-page access?

Another problem is I access the order receipt page with an mv_arg and
it looks like the capture-page "page" parameter wants just a page
name.  I tried to put "admin/receipt.html?mv_arg=1234" in there but I

terminated with an error: Can't call method "respond" on an undefined
value at /usr/local/interchange/lib/Vend/Dispatch.pm line 100.

Once I have the static HTML file I will have to convert it to PDF for
printing (unless anyone knows of a way to print parsed HTML with lpr)
and I wonder if I would be better off using something like PDF::API2
or PDF::Create to directly create PDF order receipts based on IC data
and printing those.

What would you do?

- Grant

More information about the interchange-users mailing list