ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Converting *AFPDS printer file to PDF with jpg

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

  • Converting *AFPDS printer file to PDF with jpg

    I am playing around with converting an printer file DEVTYPE(*AFPDS) to PDF output using the OVRPRTF WSCST(*PDF) parameter. The problem I am running into is with a jpg image not displaying in the PDF file. If I do a DSPF of the stream file on the iSeries it appears to be contained in the stream file but when I view the PDF with Acrobat Reader the jpg image is not showing but the other information is. Has anyone used the OVRPRTF WSCST(*PDF) to convert spooled output containing a jpg image?

    Thanks,
    Bruce

  • #2
    Re: Converting *AFPDS printer file to PDF with jpg

    Can you show what the path for the image looks like in the stream file?
    Michael Catalani
    IS Director, eCommerce & Web Development
    Acceptance Insurance Corporation
    www.AcceptanceInsurance.com
    www.ProvatoSys.com

    Comment


    • #3
      Re: Converting *AFPDS printer file to PDF with jpg

      I have the great opportunity of working on V5R4 and have no such option....
      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


      • #4
        Re: Converting *AFPDS printer file to PDF with jpg

        The stream file does not have a path that I can tell. It looks like to me the image is embedded between a "stream" and "endstream" tags.

        Comment


        • #5
          Re: Converting *AFPDS printer file to PDF with jpg

          Originally posted by Bruce View Post
          The stream file does not have a path that I can tell. It looks like to me the image is embedded between a "stream" and "endstream" tags.
          Yea, that should probably be working then. If the image was pointed to via a path / link, its usually because the path isnt available on the machine you're tryng to view the document from.

          Does the jpg image happen to be a page segment or overlay of the AFPDS document is created?
          Michael Catalani
          IS Director, eCommerce & Web Development
          Acceptance Insurance Corporation
          www.AcceptanceInsurance.com
          www.ProvatoSys.com

          Comment


          • #6
            Re: Converting *AFPDS printer file to PDF with jpg

            For testing I have keep it simple so the the print file only contains two records one for text and the other for the image.
            A R RPTD
            A O 2'MO#'
            A MO 10A O 12
            A R RPTI AFPRSC('0001028.jpg' +
            A *JFIF 10.2 11.2 +
            A (*PATH *CWD))


            All the rpg program does is set the of MO variable and write both record formats.
            MO = '1234567890';
            WRITE RPTD;
            WRITE RPTI;
            *INLR = *On;
            return;

            The cl contains a change directory so the image can be found and the print file override.
            cd '/fecginew'
            OVRPRTF FILE(AFPTSTP) DEVTYPE(*AFPDS) WSCST(*PDF) +
            TOSTMF('/fecginew/pdf/afptst.pdf')
            CALL PGM(AFPTSTR)

            Comment


            • #7
              Re: Converting *AFPDS printer file to PDF with jpg

              I would change the override to get rid of the PDF and output stream stuff, and allow the document to print as an AFPDS document to a printer, and then check to see if the image shows up.

              If the image prints on the AFPDS document, it should also print on the pdf. If it doesnt print on the afpds document, then the path for the image resource is probably not correct, which would keep it from working on the PDF conversion.

              There is also the possibility of a CCSID issue between the image itself and the rest of the document. But I would try to print the document as an AFPDS document first, then go from there.
              Michael Catalani
              IS Director, eCommerce & Web Development
              Acceptance Insurance Corporation
              www.AcceptanceInsurance.com
              www.ProvatoSys.com

              Comment

              Working...
              X