Loading ...
Sorry, an error occurred while loading the content.

FOP as a Servlet - Images won't display!

Expand Messages
  • carbonejim
    I ve searched every place I can think of, and tried everything too. I m trying to put a graphic into a PDF using FOP 0.20.3 as a servlet. Graphics to appear
    Message 1 of 9 , Mar 26, 2002
    • 0 Attachment
      I've searched every place I can think of, and tried everything too.
      I'm trying to put a graphic into a PDF using FOP 0.20.3 as a
      servlet. Graphics to appear in my documents when I run FOP from the
      command line.

      Here is a list of some things that I've tried:

      First, I put the img in almost every directory in Apache Tomcat

      No image displays
      -----------------
      1: Used this fo tag - <fo:external-graphic src="url(imgs/jpeg.jpg)"/>
      2: Used this fo tag - <fo:external-graphic src="imgs/jpeg.jpg"/>
      3: Used this fo tag - <fo:external-graphic src="jpeg.jpg"/>

      No document displays
      --------------------
      4: Used this fo tag - <fo:external-graphic
      src="http://localhost:8080/examples/imgs/jpeg.jpg"/>
      5: Used this fo tag - <fo:external-graphic
      src="file:c:\imgs\jpeg.jpg"/>
      6: Used this fo tag - <fo:external-graphic src="/imgs/jpeg.jpg"/>
      7: Used this fo tag - <fo:external-graphic src="url(/imgs/jpeg.jpg)"/>
      8: Used this fo tag - <fo:external-graphic src="url
      (http://localhost:8080/examples/imgs/jpeg.jpg)"/>

      When no image displays in the document I can see this error message:

      ERROR 10171 [fop ] (): Error while creating area : Error with
      image URL: imgs\jpeg.jpg (The system cannot find the path specified)
      and no base directory is specified


      Help! And you will sleep well knowing that you saved a person from
      jumping out a four story window! Thanks!

      Jim
    • Dominic_Botham
      Hey, Use this thing i think this should work. src= file:url(imgs/jpeg.jpg) Dominic Botham ________________________ GE-GDC, Satyam Tel: +91-40-784-6101 Ext.
      Message 2 of 9 , Mar 26, 2002
      • 0 Attachment
        Hey,
        Use this thing i think this should work.
        src="file:url(imgs/jpeg.jpg)"

        Dominic Botham
        ________________________
        GE-GDC, Satyam
        Tel:  +91-40-784-6101 Ext. 5743
        "One ship drives east and another drives west
        With the selfsame winds that blow.
        ’Tis the set of the sails and not the gales
        Which tells us the way to go.."

        -----Original Message-----
        From: carbonejim [mailto:Jim.Carbone@...]
        Sent: Tuesday, 26 March 2002 11:45 PM
        To: XSL-FO@yahoogroups.com
        Subject: [XSL-FO] FOP as a Servlet - Images won't display!

        I've searched every place I can think of, and tried everything too. 
        I'm trying to put a graphic into a PDF using FOP 0.20.3 as a
        servlet.  Graphics to appear in my documents when I run FOP from the
        command line.

        Here is a list of some things that I've tried:

        First, I put the img in almost every directory in Apache Tomcat

        No image displays
        -----------------
        1: Used this fo tag - <fo:external-graphic src="url(imgs/jpeg.jpg)"/>
        2: Used this fo tag - <fo:external-graphic src="imgs/jpeg.jpg"/>
        3: Used this fo tag - <fo:external-graphic src="jpeg.jpg"/>

        No document displays
        --------------------
        4: Used this fo tag - <fo:external-graphic
        src="http://localhost:8080/examples/imgs/jpeg.jpg"/>
        5: Used this fo tag - <fo:external-graphic
        src="file:c:\imgs\jpeg.jpg"/>
        6: Used this fo tag - <fo:external-graphic src="/imgs/jpeg.jpg"/>
        7: Used this fo tag - <fo:external-graphic src="url(/imgs/jpeg.jpg)"/>
        8: Used this fo tag - <fo:external-graphic src="url
        (http://localhost:8080/examples/imgs/jpeg.jpg)"/>

        When no image displays in the document I can see this error message:

        ERROR   10171   [fop     ] (): Error while creating area : Error with
        image URL: imgs\jpeg.jpg (The system cannot find the path specified)
        and no base directory is specified


        Help!  And you will sleep well knowing that you saved a person from
        jumping out a four story window!  Thanks!

        Jim



        To unsubscribe from this group, send an email to:
        XSL-FO-unsubscribe@egroups.com



        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

        **************************************************************************

        This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.

        **************************************************************************

      • carbonejim
        That doesn t work either. Let me try to understand this. url(...) is used to convert a relative path to a virtual path? So my relative url of img/jpeg.jpg
        Message 3 of 9 , Mar 26, 2002
        • 0 Attachment
          That doesn't work either. Let me try to understand this. url(...)
          is used to convert a relative path to a virtual path? So my relative
          url of "img/jpeg.jpg" would convert to my Apache Tomcat root dir:

          "http://localhost:8080/imgs/jpeg/jpg" (This url displays my picture)

          My root is the default: "C:\Program Files\Apache Tomcat 4.0
          \webapps\ROOT\"

          So FOP should pick this up? But it doesn't! Is it my
          configuration? Does anyone else envoke FOP from a Servlet with
          images?

          -Jim


          --- In XSL-FO@y..., Dominic_Botham <dominic_botham@s...> wrote:
          > Hey,
          > Use this thing i think this should work.
          > src="file:url(imgs/jpeg.jpg)"
          >
          > Dominic Botham
          > ________________________
          > GE-GDC, Satyam
          > Tel: +91-40-784-6101 Ext. 5743
          > "One ship drives east and another drives west
          > With the selfsame winds that blow.
          > 'Tis the set of the sails and not the gales
          > Which tells us the way to go.."
          >
          > -----Original Message-----
          > From: carbonejim [mailto:Jim.Carbone@N...]
          > Sent: Tuesday, 26 March 2002 11:45 PM
          > To: XSL-FO@y...
          > Subject: [XSL-FO] FOP as a Servlet - Images won't display!
          >
          >
          > I've searched every place I can think of, and tried everything
          too.
          > I'm trying to put a graphic into a PDF using FOP 0.20.3 as a
          > servlet. Graphics to appear in my documents when I run FOP from
          the
          > command line.
          >
          > Here is a list of some things that I've tried:
          >
          > First, I put the img in almost every directory in Apache Tomcat
          >
          > No image displays
          > -----------------
          > 1: Used this fo tag - <fo:external-graphic src="url
          (imgs/jpeg.jpg)"/>
          > 2: Used this fo tag - <fo:external-graphic src="imgs/jpeg.jpg"/>
          > 3: Used this fo tag - <fo:external-graphic src="jpeg.jpg"/>
          >
          > No document displays
          > --------------------
          > 4: Used this fo tag - <fo:external-graphic
          > src=" http://localhost:8080/examples/imgs/jpeg.jpg
          > <http://localhost:8080/examples/imgs/jpeg.jpg> "/>
          > 5: Used this fo tag - <fo:external-graphic
          > src="file:c:\imgs\jpeg.jpg"/>
          > 6: Used this fo tag - <fo:external-graphic src="/imgs/jpeg.jpg"/>
          > 7: Used this fo tag - <fo:external-graphic src="url
          (/imgs/jpeg.jpg)"/>
          > 8: Used this fo tag - <fo:external-graphic src="url
          > ( http://localhost:8080/examples/imgs/jpeg.jpg)
          > <http://localhost:8080/examples/imgs/jpeg.jpg)> "/>
          >
          > When no image displays in the document I can see this error message:
          >
          > ERROR 10171 [fop ] (): Error while creating area : Error
          with
          > image URL: imgs\jpeg.jpg (The system cannot find the path
          specified)
          > and no base directory is specified
          >
          >
          > Help! And you will sleep well knowing that you saved a person from
          > jumping out a four story window! Thanks!
          >
          > Jim
          >
          >
          >
          > Yahoo! Groups Sponsor
          >
          > ADVERTISEMENT
          >
          >
          <http://rd.yahoo.com/M=217097.1884387.3412360.1261774/D=egroupweb/S=17
          050160
          > 61:HM/A=999859/R=0/*http://service.bfast.com/bfast/click?
          bfmid=29150849&site
          > id=39282504&bfpage=account>
          >
          > <http://us.adserver.yahoo.com/l?
          M=217097.1884387.3412360.1261774/D=egroupmai
          > l/S=1705016061:HM/A=999859/rand=200104477>
          >
          > To unsubscribe from this group, send an email to:
          > XSL-FO-unsubscribe@e...
          >
          >
          >
          > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
          > <http://docs.yahoo.com/info/terms/> .
          >
          >
          >
          **********************************************************************
          ****
          > This email (including any attachments) is intended for the sole use
          of the
          > intended recipient/s and may contain material that is CONFIDENTIAL
          AND
          > PRIVATE COMPANY INFORMATION. Any review or reliance by others or
          copying or
          > distribution or forwarding of any or all of the contents in this
          message is
          > STRICTLY PROHIBITED. If you are not the intended recipient, please
          contact
          > the sender by email and delete all copies; your cooperation in this
          regard
          > is appreciated.
          >
          **********************************************************************
          ****
        • Katz, Michael
          This works for us. FOP0.19.0, called from a ATGDyamo servlet.
          Message 4 of 9 , Mar 29, 2002
          • 0 Attachment
            RE: [XSL-FO] Re: FOP as a Servlet - Images won't display!

            This works for us. FOP0.19.0, called from a ATGDyamo servlet.
            <fo:block>
                    <fo:external-graphic width="77mm" src="file:/opt/webdoc/images/destiny.jpg"/>
            </fo:block>

            -----Original Message-----
            From: carbonejim [mailto:Jim.Carbone@...]
            Sent: Tuesday, March 26, 2002 3:41 PM
            To: XSL-FO@yahoogroups.com
            Subject: [XSL-FO] Re: FOP as a Servlet - Images won't display!


            That doesn't work either.  Let me try to understand this.  url(...)
            is used to convert a relative path to a virtual path?  So my relative
            url of "img/jpeg.jpg" would convert to my Apache Tomcat root dir:

            "http://localhost:8080/imgs/jpeg/jpg"  (This url displays my picture)

            My root is the default:  "C:\Program Files\Apache Tomcat 4.0
            \webapps\ROOT\"

            So FOP should pick this up?  But it doesn't!  Is it my
            configuration?  Does anyone else envoke FOP from a Servlet with
            images?

            -Jim


            --- In XSL-FO@y..., Dominic_Botham <dominic_botham@s...> wrote:
            > Hey,
            > Use this thing i think this should work.
            > src="file:url(imgs/jpeg.jpg)"
            >
            > Dominic Botham
            > ________________________
            > GE-GDC, Satyam
            > Tel:  +91-40-784-6101 Ext. 5743
            > "One ship drives east and another drives west
            > With the selfsame winds that blow.
            > 'Tis the set of the sails and not the gales
            > Which tells us the way to go.."
            >
            > -----Original Message-----
            > From: carbonejim [mailto:Jim.Carbone@N...]
            > Sent: Tuesday, 26 March 2002 11:45 PM
            > To: XSL-FO@y...
            > Subject: [XSL-FO] FOP as a Servlet - Images won't display!
            >
            >
            > I've searched every place I can think of, and tried everything
            too. 
            > I'm trying to put a graphic into a PDF using FOP 0.20.3 as a
            > servlet.  Graphics to appear in my documents when I run FOP from
            the
            > command line.
            >
            > Here is a list of some things that I've tried:
            >
            > First, I put the img in almost every directory in Apache Tomcat
            >
            > No image displays
            > -----------------
            > 1: Used this fo tag - <fo:external-graphic src="url
            (imgs/jpeg.jpg)"/>
            > 2: Used this fo tag - <fo:external-graphic src="imgs/jpeg.jpg"/>
            > 3: Used this fo tag - <fo:external-graphic src="jpeg.jpg"/>
            >
            > No document displays
            > --------------------
            > 4: Used this fo tag - <fo:external-graphic
            > src=" http://localhost:8080/examples/imgs/jpeg.jpg
            > <http://localhost:8080/examples/imgs/jpeg.jpg> "/>
            > 5: Used this fo tag - <fo:external-graphic
            > src="file:c:\imgs\jpeg.jpg"/>
            > 6: Used this fo tag - <fo:external-graphic src="/imgs/jpeg.jpg"/>
            > 7: Used this fo tag - <fo:external-graphic src="url
            (/imgs/jpeg.jpg)"/>
            > 8: Used this fo tag - <fo:external-graphic src="url
            > ( http://localhost:8080/examples/imgs/jpeg.jpg)
            > <http://localhost:8080/examples/imgs/jpeg.jpg)> "/>
            >
            > When no image displays in the document I can see this error message:
            >
            > ERROR   10171   [fop     ] (): Error while creating area : Error
            with
            > image URL: imgs\jpeg.jpg (The system cannot find the path
            specified)
            > and no base directory is specified
            >
            >
            > Help!  And you will sleep well knowing that you saved a person from
            > jumping out a four story window!  Thanks!
            >
            > Jim
            >
            >
            >
            > Yahoo! Groups Sponsor
            >
            > ADVERTISEMENT

            >
            <http://rd.yahoo.com/M=217097.1884387.3412360.1261774/D=egroupweb/S=17
            050160
            > 61:HM/A=999859/R=0/*http://service.bfast.com/bfast/click?
            bfmid=29150849&site
            > id=39282504&bfpage=account>  

            > <http://us.adserver.yahoo.com/l?
            M=217097.1884387.3412360.1261774/D=egroupmai
            > l/S=1705016061:HM/A=999859/rand=200104477>   
            >
            > To unsubscribe from this group, send an email to:
            > XSL-FO-unsubscribe@e...
            >
            >
            >
            > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
            > <http://docs.yahoo.com/info/terms/> .
            >
            >
            >
            **********************************************************************
            ****
            > This email (including any attachments) is intended for the sole use
            of the
            > intended recipient/s and may contain material that is CONFIDENTIAL
            AND
            > PRIVATE COMPANY INFORMATION. Any review or reliance by others or
            copying or
            > distribution or forwarding of any or all of the contents in this
            message is
            > STRICTLY PROHIBITED. If you are not the intended recipient, please
            contact
            > the sender by email and delete all copies; your cooperation in this
            regard
            > is appreciated.
            >
            **********************************************************************
            ****


            ------------------------ Yahoo! Groups Sponsor ---------------------~-->
            Buy Stock for $4.
            No Minimums.
            FREE Money 2002.
            http://us.click.yahoo.com/BgmYkB/VovDAA/ySSFAA/9rHolB/TM
            ---------------------------------------------------------------------~->

            To unsubscribe from this group, send an email to:
            XSL-FO-unsubscribe@egroups.com

             

            Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



            ***********************************************
            Confidentiality Note:  This E-mail is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure.  Dissemination, distribution or copying of this E-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited.  If you have received this E-mail in error, please call the Mgr. of Information Technology at 301.222.0330 and destroy the original message and all copies.


          • Oleg Tkachenko
            Hello ! It works in fop0.20.3 fine for me from servlet with this tag:
            Message 5 of 9 , Mar 31, 2002
            • 0 Attachment
              Hello !

              It works in fop0.20.3 fine for me from servlet with this tag:

              <fo:external-graphic scaling="uniform"
              src="http://192.168.1.103/eXperanto/Repository?res=IMAGE&sel=default_top200"/>

              Make sure your server returns right mime type.


              > First, I put the img in almost every directory in Apache Tomcat
              >
              > No image displays
              > -----------------
              > 1: Used this fo tag - <fo:external-graphic src="url(imgs/jpeg.jpg)"/>
              > 2: Used this fo tag - <fo:external-graphic src="imgs/jpeg.jpg"/>
              > 3: Used this fo tag - <fo:external-graphic src="jpeg.jpg"/>
              You have specify base directory, but I'm not aware how, try ask in fop
              maillist.

              > No document displays
              What do you mean "no document" ? Do you get some exception?

              > 4: Used this fo tag - <fo:external-graphic
              > src="http://localhost:8080/examples/imgs/jpeg.jpg"/>
              > 5: Used this fo tag - <fo:external-graphic
              > src="file:c:\imgs\jpeg.jpg"/>
              Try file:///c:/imgs/jpeg.jpg

              --
              Oleg Tkachenko
              Multiconn International, Israel
            • Bryan Rasmussen
              RE: [XSL-FO] Re: FOP as a Servlet - Images won t display! I first learned about image magic as a tool to work with pdfs from this list(although I can t
              Message 6 of 9 , Apr 2 12:37 AM
              • 0 Attachment
                RE: [XSL-FO] Re: FOP as a Servlet - Images won't display!
                 
                I first learned about image magic as a tool to work with pdfs from this list(although I can't remember who posted), I've got it now and am doing some work with it, unfortunately I can't seem to output images from pdf, and the documentation seems unclear to me on this part - since I can do the other things the documentation talks about, changing resolution of images, blurring etc. the documentation must be unclear if I can't get that one last part to work.
                If someone has worked with image magic with their pdfs can you give me some pointers, sample command lines.
              • Oleg Tkachenko
                RE: [XSL-FO] Re: FOP as a Servlet - Images won t display!Hello ! I ve tried ImageMagick (its Java port JMagick actually) some weeks ago and I was succesfull to
                Message 7 of 9 , Apr 2 9:36 AM
                • 0 Attachment
                  RE: [XSL-FO] Re: FOP as a Servlet - Images won't display!
                  Hello !
                   
                  I've tried ImageMagick (its Java port JMagick actually) some weeks ago and I was succesfull to get pdf2tiff transformation in a servlet. What I remember is installing of GhostScript, adding GhostScript's bin directory to the PATH, adding ImagemAgick's directory to PATH and MAGICK_HOME and a great battle with compiling JMagick for Windows.

                  ---
                  Oleg Tkachenko,
                  Multiconn International, Israel

                  -----Original Message-----
                  From: Bryan Rasmussen [mailto:bry@...]
                  Sent: Tuesday, April 02, 2002 10:38 AM
                  To: XSL-FO@yahoogroups.com
                  Subject: [XSL-FO] side subject- image magic with pdf

                   
                  I first learned about image magic as a tool to work with pdfs from this list(although I can't remember who posted), I've got it now and am doing some work with it, unfortunately I can't seem to output images from pdf, and the documentation seems unclear to me on this part - since I can do the other things the documentation talks about, changing resolution of images, blurring etc. the documentation must be unclear if I can't get that one last part to work.
                  If someone has worked with image magic with their pdfs can you give me some pointers, sample command lines.


                  To unsubscribe from this group, send an email to:
                  XSL-FO-unsubscribe@egroups.com



                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
                • Bryan Rasmussen
                  RE: [XSL-FO] Re: FOP as a Servlet - Images won t display!Oleg wrote: I ve tried ImageMagick (its Java port JMagick actually) some weeks ago and I was
                  Message 8 of 9 , Apr 3 1:02 AM
                  • 0 Attachment
                    RE: [XSL-FO] Re: FOP as a Servlet - Images won't display!
                    Oleg wrote: I've tried ImageMagick (its Java port JMagick actually) some weeks ago and I was succesfull to get pdf2tiff transformation in a servlet. What I  remember is installing of GhostScript, adding GhostScript's bin directory to the PATH, adding ImagemAgick's directory to PATH and MAGICK_HOME  and a great battle with compiling JMagick for Windows.
                    [Bryan Rasmussen] Thanks; I think it's probably a GhostScript problem like you indicate; I'm doing my stuff from the commandline so hopefully I won't have to worry about JMagick. :)
                  • alzoid69
                    You need to specify a Base Directory because FOP needs it to display external resourses. You can do it the the fop configuration file
                    Message 9 of 9 , Jan 8, 2005
                    • 0 Attachment
                      You need to specify a Base Directory because FOP needs it to display
                      external resourses. You can do it the the fop configuration file
                      {fop-dir}/conf/userconfig.xml. Or you can do it with Java code (my
                      prefrence)

                      Here is my code in the doGet():
                      ...

                      ServletContext servletContext = getServletConfig().getServletContext();

                      String appPath = servletContext.getRealPath(""); //root of web app
                      org.apache.fop.configuration.Configuration.put("baseDir",appPath);

                      ...

                      My FOP looks like this:

                      <fo:external-graphic src="file:images/logo.jpg"/>

                      Hope this helps.

                      Allan


                      --- In XSL-FO@yahoogroups.com, "carbonejim" <Jim.Carbone@N...> wrote:
                      > I've searched every place I can think of, and tried everything too.
                      > I'm trying to put a graphic into a PDF using FOP 0.20.3 as a
                      > servlet. Graphics to appear in my documents when I run FOP from the
                      > command line.
                      >
                      > Here is a list of some things that I've tried:
                      >
                      > First, I put the img in almost every directory in Apache Tomcat
                      >
                      > No image displays
                      > -----------------
                      > 1: Used this fo tag - <fo:external-graphic src="url(imgs/jpeg.jpg)"/>
                      > 2: Used this fo tag - <fo:external-graphic src="imgs/jpeg.jpg"/>
                      > 3: Used this fo tag - <fo:external-graphic src="jpeg.jpg"/>
                      >
                      > No document displays
                      > --------------------
                      > 4: Used this fo tag - <fo:external-graphic
                      > src="http://localhost:8080/examples/imgs/jpeg.jpg"/>
                      > 5: Used this fo tag - <fo:external-graphic
                      > src="file:c:\imgs\jpeg.jpg"/>
                      > 6: Used this fo tag - <fo:external-graphic src="/imgs/jpeg.jpg"/>
                      > 7: Used this fo tag - <fo:external-graphic src="url(/imgs/jpeg.jpg)"/>
                      > 8: Used this fo tag - <fo:external-graphic src="url
                      > (http://localhost:8080/examples/imgs/jpeg.jpg)"/>
                      >
                      > When no image displays in the document I can see this error message:
                      >
                      > ERROR 10171 [fop ] (): Error while creating area : Error with
                      > image URL: imgs\jpeg.jpg (The system cannot find the path specified)
                      > and no base directory is specified
                      >
                      >
                      > Help! And you will sleep well knowing that you saved a person from
                      > jumping out a four story window! Thanks!
                      >
                      > Jim
                    Your message has been successfully submitted and would be delivered to recipients shortly.