ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Print HTML document from RPG?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Print HTML document from RPG?

    Not sure if I posted this before (can't find it in search, but auto-fill seems to think I have). So sorry if I have already.

    I have a packing slips stored on the IFS as separate HTML files. I need to print these on a Systemi printer. Ideally, I would like to invoke this from w/in RPG pgm. The printer is actually connected to a PC running emulation, and the aforementioned RPG pgm.

    Converting to a PDF is not an option... the Java converter doesn't like the HTML format.

    Right now we are opening each one individually and printing.

  • #2
    Re: Print HTML document from RPG?

    maybe here
    http://www.code400.com/forum/showthread.php/8127-Printing-IFS-documents-on-network-printers

    j
    amie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: Print HTML document from RPG?

      Your HTML files need to be converted to a format the printer you will be using understands. Your able to print them through windows because the printer driver converts it to a format the printer understands. You can use the technique Jamie posted or FTP the files to the printer, however you will just get a bunch of garbage. Some printers understand the PDF format and those can be directly sent.

      I have been trying to do this for a project I am on, have not been having much luck also. One idea I have been exploring is to run Open Office as a service on a on Windows server and trying use that to convert the documents. Other options you can try is to convert the HTML to PCL then send it to the printer. There are some routines in java, PHP or PERL that can do that for you. In my case the HTML files I am working with are not converting to PDF's or PCL formats.

      Comment


      • #4
        Re: Print HTML document from RPG?

        I read that thread previously, but I couldn't find any info on handling an HTML file. I went as far as downloading HTML2PDF4I, but the java methods used do not like the contents of my vendor's HTML file. I also could not find a command line arguement for iexplorer.exe to print - I would have used STRPCO to run that.

        DAG - Our printers are all PCL, so I'm fairly certian that they will not recognize HTML w/out another piece of software.

        In fact, I had resigned myself to the fact that we would need to print these manually... But there doesn't seem to be a way to do that quickly either. IE is painfully slow (open one, print one, close) and prompts fro the printer each time. Tried selecting all the files in windows, right-click on the group, select print - with only 35 files the PC was overwhelmed.

        Comment


        • #5
          Re: Print HTML document from RPG?

          You may have to retreive the info from the HTML document and print it in your own format

          Comment


          • #6
            Re: Print HTML document from RPG?

            Gwilburn, reread what I posted. You have to convert your HTML files. In your case to PCL. There are routines out there in Perl, Java and PHP that can do this. I would try one of these.

            Comment


            • #7
              Re: Print HTML document from RPG?

              Originally posted by DAG0000 View Post
              Gwilburn, reread what I posted. You have to convert your HTML files. In your case to PCL. There are routines out there in Perl, Java and PHP that can do this. I would try one of these.
              I completely understand that. I was just hoping to avoid a lot of searching... I don't care for the Java methods that I have used in the past - they are very slow. However, I found a PC utility to print html from a command line. It works fairly well, but is having trouble with a CSS reference.

              Henrik - I was hoping to avoid replication of their packing slip as the format varies AND they tend to change it quite often. Also, it contains logos with references.

              At this point I will likely just let this go until the volume dictates otherwise. Thanks for your suggestions.

              Comment


              • #8
                Re: Print HTML document from RPG?

                As far as I remember we had this discussion in an iNetWork tread some month ago and I gave you a similar solution

                Comment


                • #9
                  Re: Print HTML document from RPG?

                  Yes we did! That's where I actaully learned of the HTML2PDF4i solution (once in PDF it can be printed). However, there were quite a few HTML formatting errors that the Java methods (used by HTML2PDF4i) didn't like... so I didn't get much further. Getting the vendor (Shopatron) to adhere to stricter HTML has proven to be very difficult... if I could get them to do that, the HTM2PDF4i would likely be the solution.

                  Comment

                  Working...
                  X