Have a problem with Image

View: New views
4 Messages — Rating Filter:   Alert me  

Have a problem with Image

by Smit Chanmanon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear all,

       I am a newbie in this field, I tried to call FOP from C# with the following code,

java.lang.System.setProperty("javax.xml.transform.TransformerFactory", "org.apache.xalan.processor.TransformerFactoryImpl");
            java.lang.System.setProperty("javax.xml.parsers.SAXParserFactory", "org.apache.xerces.jaxp.SAXParserFactoryImpl");
            java.lang.System.setProperty("org.xml.sax.driver", "org.apache.xerces.jaxp.SAXParserFactoryImpl");
            org.apache.xerces.jaxp.SAXParserFactoryImpl sax = new org.apache.xerces.jaxp.SAXParserFactoryImpl();
            java.lang.ClassLoader cl = sax.getClass().getClassLoader();
            java.lang.Thread.currentThread().
            setContextClassLoader(cl);
            String intput = "C:\\......\\bordershorthand.fo";
            String output = "C:\\.....\\xslfo_output.pdf";
            File _output = new File(output);
            OutputStream _outputStream = new BufferedOutputStream(new FileOutputStream(_output));
            try
            {
                FopFactory _fopFactory = FopFactory.newInstance();
                Fop _fop = _fopFactory.newFop("application/pdf", _outputStream);
                TransformerFactory _factory = TransformerFactory.newInstance();
                Transformer _transformer = _factory.newTransformer();
                Source _src = new StreamSource(new File(intput));
                Result _res = new SAXResult(_fop.getDefaultHandler());
                _transformer.transform(_src, _res);
            }
            catch (Exception ex)
            {
                _outputStream.close();
                _output.delete();
                System.Windows.Forms.MessageBox.Show(ex.ToString(), "Exception");
                //throw new InvalidOperationException(“Failed to render FO file to PDF”, ex);
            }
            finally
            {
                _outputStream.close();
            }

The application works correctly on simple file. But if I tried to convert fo files which have images for embledding (The example from apache webside). The output will lose all its images. The fop.dll is created from the following script,

ikvmc -nowarn:0109 -out:fop-0.94.dll C:\fop-0.94\lib\*.jar C:\fop-0.94\build\fop.jar

What should I do?? All images are very important, and cannot be lost.

Best Regards,

Smit Chanmanon

Re: Have a problem with Image

by John Cavalieri :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Smit,

I had this issue as well, and never solved it.  It was quite a while
ago, but I *think* I had it narrowed down to the GNU classpath URL
handling/loaders.

./java/net/URL.class
./java/net/URLClassLoader$FileResource.class
./java/net/URLClassLoader$FileURLLoader.class
./java/net/URLClassLoader$Resource.class
./java/net/URLClassLoader$URLLoader.class

-John


On Feb 11, 2008 3:42 AM, Smit Chanmanon <vanilla_cpe@...> wrote:

>
> Dear all,
>
>        I am a newbie in this field, I tried to call FOP from C# with the
> following code,
>
> java.lang.System.setProperty("javax.xml.transform.TransformerFactory",
> "org.apache.xalan.processor.TransformerFactoryImpl");
>
> java.lang.System.setProperty("javax.xml.parsers.SAXParserFactory",
> "org.apache.xerces.jaxp.SAXParserFactoryImpl");
>             java.lang.System.setProperty("org.xml.sax.driver",
> "org.apache.xerces.jaxp.SAXParserFactoryImpl");
>             org.apache.xerces.jaxp.SAXParserFactoryImpl sax = new
> org.apache.xerces.jaxp.SAXParserFactoryImpl();
>             java.lang.ClassLoader cl = sax.getClass().getClassLoader();
>             java.lang.Thread.currentThread().
>             setContextClassLoader(cl);
>             String intput = "C:\\......\\bordershorthand.fo";
>             String output = "C:\\.....\\xslfo_output.pdf";
>             File _output = new File(output);
>             OutputStream _outputStream = new BufferedOutputStream(new
> FileOutputStream(_output));
>             try
>             {
>                 FopFactory _fopFactory = FopFactory.newInstance();
>                 Fop _fop = _fopFactory.newFop("application/pdf",
> _outputStream);
>                 TransformerFactory _factory =
> TransformerFactory.newInstance();
>                 Transformer _transformer = _factory.newTransformer();
>                 Source _src = new StreamSource(new File(intput));
>                 Result _res = new SAXResult(_fop.getDefaultHandler());
>                 _transformer.transform(_src, _res);
>             }
>             catch (Exception ex)
>             {
>                 _outputStream.close();
>                 _output.delete();
>                 System.Windows.Forms.MessageBox.Show(ex.ToString(),
> "Exception");
>                 //throw new InvalidOperationException("Failed to render FO
> file to PDF", ex);
>             }
>             finally
>             {
>                 _outputStream.close();
>             }
>
> The application works correctly on simple file. But if I tried to convert fo
> files which have images for embledding (The example from apache webside).
> The output will lose all its images. The fop.dll is created from the
> following script,
>
> ikvmc -nowarn:0109 -out:fop-0.94.dll C:\fop-0.94\lib\*.jar
> C:\fop-0.94\build\fop.jar
>
> What should I do?? All images are very important, and cannot be lost.
>
> Best Regards,
>
> Smit Chanmanon
> --
> View this message in context: http://www.nabble.com/Have-a-problem-with-Image-tp15408085p15408085.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@...
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers
>



--
John Cavalieri
john.cavalieri@...

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: Have a problem with Image

by Jouni :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone!
 
I just got FOP working with .net and bumped in to same problem with the
images not showing. The resulting pdf/rtf just has a blank space where the
image should be. Has anyone found a solution?
 
I'm using FOP 0.94 and IKVM 0.36.
 
Thanks
Jouni


John Cavalieri wrote:
Hi Smit,

I had this issue as well, and never solved it.  It was quite a while
ago, but I *think* I had it narrowed down to the GNU classpath URL
handling/loaders.

./java/net/URL.class
./java/net/URLClassLoader$FileResource.class
./java/net/URLClassLoader$FileURLLoader.class
./java/net/URLClassLoader$Resource.class
./java/net/URLClassLoader$URLLoader.class

-John


On Feb 11, 2008 3:42 AM, Smit Chanmanon <vanilla_cpe@hotmail.com> wrote:
>
> Dear all,
>
>        I am a newbie in this field, I tried to call FOP from C# with the
> following code,
>
> java.lang.System.setProperty("javax.xml.transform.TransformerFactory",
> "org.apache.xalan.processor.TransformerFactoryImpl");
>
> java.lang.System.setProperty("javax.xml.parsers.SAXParserFactory",
> "org.apache.xerces.jaxp.SAXParserFactoryImpl");
>             java.lang.System.setProperty("org.xml.sax.driver",
> "org.apache.xerces.jaxp.SAXParserFactoryImpl");
>             org.apache.xerces.jaxp.SAXParserFactoryImpl sax = new
> org.apache.xerces.jaxp.SAXParserFactoryImpl();
>             java.lang.ClassLoader cl = sax.getClass().getClassLoader();
>             java.lang.Thread.currentThread().
>             setContextClassLoader(cl);
>             String intput = "C:\\......\\bordershorthand.fo";
>             String output = "C:\\.....\\xslfo_output.pdf";
>             File _output = new File(output);
>             OutputStream _outputStream = new BufferedOutputStream(new
> FileOutputStream(_output));
>             try
>             {
>                 FopFactory _fopFactory = FopFactory.newInstance();
>                 Fop _fop = _fopFactory.newFop("application/pdf",
> _outputStream);
>                 TransformerFactory _factory =
> TransformerFactory.newInstance();
>                 Transformer _transformer = _factory.newTransformer();
>                 Source _src = new StreamSource(new File(intput));
>                 Result _res = new SAXResult(_fop.getDefaultHandler());
>                 _transformer.transform(_src, _res);
>             }
>             catch (Exception ex)
>             {
>                 _outputStream.close();
>                 _output.delete();
>                 System.Windows.Forms.MessageBox.Show(ex.ToString(),
> "Exception");
>                 //throw new InvalidOperationException("Failed to render FO
> file to PDF", ex);
>             }
>             finally
>             {
>                 _outputStream.close();
>             }
>
> The application works correctly on simple file. But if I tried to convert fo
> files which have images for embledding (The example from apache webside).
> The output will lose all its images. The fop.dll is created from the
> following script,
>
> ikvmc -nowarn:0109 -out:fop-0.94.dll C:\fop-0.94\lib\*.jar
> C:\fop-0.94\build\fop.jar
>
> What should I do?? All images are very important, and cannot be lost.
>
> Best Regards,
>
> Smit Chanmanon
> --
> View this message in context: http://www.nabble.com/Have-a-problem-with-Image-tp15408085p15408085.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers
>



--
John Cavalieri
john.cavalieri@gmail.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: Have a problem with Image

by Jouni :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello again
Just a quick question: has anyone been able to get the images working with ikvm/fop combination. Searching the interweb I seem to only find questions about the same problem but never an answer.

Jouni




Hi everyone!
 
I just got FOP working with .net and bumped in to same problem with the
images not showing. The resulting pdf/rtf just has a blank space where the
image should be. Has anyone found a solution?
 
I'm using FOP 0.94 and IKVM 0.36.
 
Thanks
Jouni


John Cavalieri wrote:
Hi Smit,

I had this issue as well, and never solved it.  It was quite a while
ago, but I *think* I had it narrowed down to the GNU classpath URL
handling/loaders.

./java/net/URL.class
./java/net/URLClassLoader$FileResource.class
./java/net/URLClassLoader$FileURLLoader.class
./java/net/URLClassLoader$Resource.class
./java/net/URLClassLoader$URLLoader.class

-John


On Feb 11, 2008 3:42 AM, Smit Chanmanon <vanilla_cpe@hotmail.com> wrote:
>
> Dear all,
>
>        I am a newbie in this field, I tried to call FOP from C# with the
> following code,
>
> java.lang.System.setProperty("javax.xml.transform.TransformerFactory",
> "org.apache.xalan.processor.TransformerFactoryImpl");
>
> java.lang.System.setProperty("javax.xml.parsers.SAXParserFactory",
> "org.apache.xerces.jaxp.SAXParserFactoryImpl");
>             java.lang.System.setProperty("org.xml.sax.driver",
> "org.apache.xerces.jaxp.SAXParserFactoryImpl");
>             org.apache.xerces.jaxp.SAXParserFactoryImpl sax = new
> org.apache.xerces.jaxp.SAXParserFactoryImpl();
>             java.lang.ClassLoader cl = sax.getClass().getClassLoader();
>             java.lang.Thread.currentThread().
>             setContextClassLoader(cl);
>             String intput = "C:\\......\\bordershorthand.fo";
>             String output = "C:\\.....\\xslfo_output.pdf";
>             File _output = new File(output);
>             OutputStream _outputStream = new BufferedOutputStream(new
> FileOutputStream(_output));
>             try
>             {
>                 FopFactory _fopFactory = FopFactory.newInstance();
>                 Fop _fop = _fopFactory.newFop("application/pdf",
> _outputStream);
>                 TransformerFactory _factory =
> TransformerFactory.newInstance();
>                 Transformer _transformer = _factory.newTransformer();
>                 Source _src = new StreamSource(new File(intput));
>                 Result _res = new SAXResult(_fop.getDefaultHandler());
>                 _transformer.transform(_src, _res);
>             }
>             catch (Exception ex)
>             {
>                 _outputStream.close();
>                 _output.delete();
>                 System.Windows.Forms.MessageBox.Show(ex.ToString(),
> "Exception");
>                 //throw new InvalidOperationException("Failed to render FO
> file to PDF", ex);
>             }
>             finally
>             {
>                 _outputStream.close();
>             }
>
> The application works correctly on simple file. But if I tried to convert fo
> files which have images for embledding (The example from apache webside).
> The output will lose all its images. The fop.dll is created from the
> following script,
>
> ikvmc -nowarn:0109 -out:fop-0.94.dll C:\fop-0.94\lib\*.jar
> C:\fop-0.94\build\fop.jar
>
> What should I do?? All images are very important, and cannot be lost.
>
> Best Regards,
>
> Smit Chanmanon
> --
> View this message in context: http://www.nabble.com/Have-a-problem-with-Image-tp15408085p15408085.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers
>



--
John Cavalieri
john.cavalieri@gmail.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

LightInTheBox - Buy quality products at wholesale price!