10 Replies Latest reply on Jan 3, 2010 9:37 PM by chiptuner

    Image on Form

      I'm trying to figure out how to include an image on a Form. We currently have a form that requires a signature. We gather the form data externally via a web application and drop the template data into the JetForms Data directory. The image signature is saved as a "JPG" file. Is it possible to include a mappable picture field on the form that can include the image of the persons signature? Thru the Output designer we've created a Graphics field called "sig" but I can't figure out how to reference the image of the signature so that it is married to this form along with the other text based data.

      Hope this makes sense!
      • 0. Re: Image on Form
        Level 1
        Thanks for the quick response Tom! You are correct, the image will change with each form that is printed. They will be randomly named images (ie: 4532.jpg) and I'd like to be able to reference it in the datastream. I'm still having difficuly getting this to work properly, would mind reviewing my .DAT and .DA1 files data below and see if you see anything wrong?

        .DAT contents:
        --------------
        ^JOB "c:\program files\adobe\central\naf\mdf\TEST.MDF" -aapon -afxon -z"\\PRINT\HP4200-L" -c1
        ^page 1
        ^file test.DA1

        .DA1 contents:
        --------------
        ^field CUSTNUM
        5432432432
        ^field sig
        \graph "c:\Program Files\Adobe\Central\JetFOrms\Server\data\4324.jpg"
        • 2. Re: Image on Form
          Level 1
          I'm assuming the signature is not static but varies. If so, you are on the right track by using a "grapic field". It is just like any other field on the form. There has to be a reference to it in the data stream. It's value would be the path and file name of the JPG file. If the signature is static then just use a "logo" on the form design itself.
          • 3. Re: Image on Form
            Level 1
            You put your jobs together differently than we do. Our application builds a single file, including the data after the ^job statement. We also print multiple forms so we include ^form commands instead of using a form name for the ^job name. Another difference is that we use ^global for almost all data fields. The following represents our job. This is just the beginning & end of the file; we actually have lots of more ^global references before the first ^form statement.

            ^job PF -zSEMS-9050 -aspHP9050 -apfon -afxon -aapon
            ^Global FT_RECORD_NO
            00000
            ^global recordno
            1426
            ^FORM _base_page_v1r3.mdf
            ^field MannerOfServiceImage

            b C:\JetForm\Forms\FirstClass.jpg

            ^FORM sep-pg7-v1r1-c.mdf
            ^field CP_ADDRESS_LINES
            WORKER 01 TEMPORARY
            P O BOX 45011
            515 E 100 S
            SALT LAKE CITY UT 84145-0011
            ^FORM f-09-801-v1r2.mdf
            ^FORM f-09-801-v1r2-s.mdf

            Note - the blank lines before & after the graphic file name aren't really there. I had to add them to get things to look right.

            The biggest difference I see regarding the graphic element is your use of the
            b \graph
            command. This command inserts the referenced graphic at the "current" position on the page. Since there has been no data value for the field "sig" yet, at best I would expect the graphic to begin at the end of the CUSTNUM field, not at the location of "sig". As you can see from our file, when using a graphics field you just supply the path to the graphic as the actual data value. I have no idea if the quotes around it (because of the space in the path name) is required or not. The other thing I notice about your file is the space after \graph. I have not used the command but the samples in the manual don't show the space.
            • 4. Re: Image on Form
              Level 1
              For some reason I'm still not getting the image to print on the form. I'm placing the image in the Data directory, is that the correct location? Also, when the .DAT and .DA1 files are picked up and processed they are deleted afterwards but the image file stays in the directory. I'm not seeing any log error so I'm having a little difficulty trying to figure out what to look at. Are there any INI files or config settings that have to be modified to handle graphics? I've also changed my .DA1 file to look like this and didn't have any luck. Any suggestions on how to troubleshoot this?

              .DA1 contents:
              --------------
              ^field CUSTNUM
              5432432432
              ^field sig
              c:\PROGRA~1\Adobe\Central\JetFOrms\Server\data\4324.jpg
              • 5. Re: Image on Form
                Level 1
                I finally found an error log, it reads:
                2007/04/23 16:57:07 C:\Program Files\Adobe\Central\Bin\jfmerge: [125]* Processing data file: 'C:\Program Files\Adobe\Central\Server\Data\test.dat'.
                2007/04/23 16:57:07 C:\Program Files\Adobe\Central\Bin\jfmerge: [289]MDF file `c:\program files\adobe\central\naf\mdf\test.MDF' opened.
                2007/04/23 16:57:07 C:\Program Files\Adobe\Central\Bin\jfmerge: [219]Incomplete last line within file 'c:\program files\adobe\central\server\data\test.DA1'.
                2007/04/23 16:57:07 C:\Program Files\Adobe\Central\Bin\jfmerge: [209]One surface was printed.

                TEST.DA1 contains:
                ^field CUSTNUM
                432432432
                ^field sig
                car.jpg
                • 6. Re: Image on Form
                  Level 1
                  You are correct - Central won't delete the graphic file. It doesn't 'know' that it is associated with the job. Where you put them doesn't really matter since you are providing the complete path.

                  I set up a test job and form to simulate yours. It worked just fine. The results looked even better after I enarged the graphic field to accomodate the actual size of the image. A 1 line high image of a postage stamp was a bit difficult to tell what it was.

                  Therefore, since it works for me it must be an option or INI setting.

                  Besides changing the verbosity of some of the error messages we make two other changes to the jfmerge.ini file.

                  * In the [Field] section we set Reformat=Trunc

                  * In the [PDFPrep] section we add ExternalSubforms=1

                  Neither of these have anything to do with images. The options on the ^job line have nothing to do with images, either. I'm stumped as to why you are having a problem. You might set verbosity to the "trace" setting (-v0 on the ^job line) to see if something shows up in the log file.

                  Just for grins, here is the contents of my test files.

                  ^job test -zSEMS-9050 -aspHP9050 -apfon -afxon -aapon
                  ^page 1
                  ^file test.DA1

                  and

                  ^field CUSTNUM
                  5432432432
                  ^field sig
                  C:\JetForm\Forms\FirstClass.jpg

                  All I did was use Output Designer to add the two fields onto a new form and then compiled the form. (Oh, I also deleted a "test" job from the JMD so it would use the job name for the form name.)
                  • 7. Re: Image on Form
                    Level 1
                    I seem to be getting a little closer now.... Do you know what the following error message is related to and possibly how to correct?

                    2007/04/23 17:14:03 C:\Program Files\Adobe\Central\Bin\jfmerge: [127]Unable to open logo file 'c:\JetForms\test.jpg'.
                    • 8. Re: Image on Form
                      Level 1
                      Just for grins I told it to use a .pcx file instead of a .jpg file and it worked. Is there anything that needs to be turned on or configured to allow .jpg files?
                      • 9. Re: Image on Form
                        Level 1
                        I would think that the error is exactly what it says. I thought you had indicated earlier you were putting it in the "data" folder. If you didn't change the location and that is the case then the path is incomplete.

                        Are you using Central or Central Pro & what is the version #? I'm using Central Pro version 5.6.0.308 (the original release version - no patches). I'm not sure of the difference between the "Pro" version and non-Pro versions but it might make a difference, as could the release numbers. I know they dropped support for a particular graphic format for a while - but I'm pretty sure it wasn't JPG.

                        Can you get at the JPG from Output Designer as a "logo"? If so, I don't see why the print agent (jfmerge.exe) couldn't find it.
                        • 10. Re: Image on Form
                          chiptuner

                          can you solved the problem?