You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by tp1705424 <To...@prodyna.de> on 2011/11/09 17:39:02 UTC
Creating FopImage
I want to create a FopImage.
Thats the way i try to do it:
fopImage=imageFactory.loadImage("file:/d:/Grafiken/smiley.bmp", foUserAgent)
byte[] bytes=fopImage.getRessourceBytes();
My problem is that that the method getRessourceBytes() allways returns null.
I need the byte Array to fill a ImageObject of type
org.apache.fop.render.afp.modca.ImageObject
AFPDataStream afpStream= new AFPDataStream();
afpStream.startDocument(out);
afpStream.startPage(2970, 2100, 0);
afpStream.createLine(1000, 0, 1000, 2000, 10, Color.BLACK);
afpStream.endPage();
afpStream.startPage(2970, 2100, 0);
ImageObject imageObject=afpStream.getImageObject(0, 0, 1000, 1000);
Can anybody give me a hint how I'm able to create a simple FopImage?
And why the getRessourceBytes() allways returns null?
I'm thankful for every Idea.
Tobias
--
View this message in context: http://old.nabble.com/Creating-FopImage-tp32812197p32812197.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
RE: Creating FopImage
Posted by tp1705424 <To...@prodyna.de>.
Amick, Eric wrote:
>
>> -----Original Message-----
>> From: tp1705424 [mailto:Tobias.Priebs@prodyna.de]
>> Sent: Wednesday, November 9, 2011 11:39
>> To: fop-users@xmlgraphics.apache.org
>> Subject: Creating FopImage
>>
>>
>> I want to create a FopImage.
>> Thats the way i try to do it:
>>
>> fopImage=imageFactory.loadImage("file:/d:/Grafiken/smiley.bmp",
>> foUserAgent)
>> byte[] bytes=fopImage.getRessourceBytes();
>>
>>
>> My problem is that that the method getRessourceBytes() allways returns
>> null.
>> I need the byte Array to fill a ImageObject of type
>> org.apache.fop.render.afp.modca.ImageObject
>>
>> AFPDataStream afpStream= new AFPDataStream();
>> afpStream.startDocument(out);
>> afpStream.startPage(2970, 2100, 0);
>> afpStream.createLine(1000, 0, 1000, 2000, 10, Color.BLACK);
>>
>> afpStream.endPage();
>> afpStream.startPage(2970, 2100, 0);
>> ImageObject imageObject=afpStream.getImageObject(0, 0, 1000, 1000);
>>
>> Can anybody give me a hint how I'm able to create a simple FopImage?
>> And why the getRessourceBytes() allways returns null?
>>
>> I'm thankful for every Idea.
>> Tobias
>
> The URL should start with "file://", but I don't know if that will
> necessarily solve your problem.
>
> Eric Amick Systems Engineer II
> Legislative Computer Systems
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
Thank you Eric.
But with my old version the images get loaded, if i try your changement the
image does'nt get loaded.
And the fopImage is null.
So that doesn't solve my problem.
--
View this message in context: http://old.nabble.com/Creating-FopImage-tp32812197p32818609.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
RE: Creating FopImage
Posted by "Amick, Eric" <Er...@mail.house.gov>.
> -----Original Message-----
> From: tp1705424 [mailto:Tobias.Priebs@prodyna.de]
> Sent: Wednesday, November 9, 2011 11:39
> To: fop-users@xmlgraphics.apache.org
> Subject: Creating FopImage
>
>
> I want to create a FopImage.
> Thats the way i try to do it:
>
> fopImage=imageFactory.loadImage("file:/d:/Grafiken/smiley.bmp",
> foUserAgent)
> byte[] bytes=fopImage.getRessourceBytes();
>
>
> My problem is that that the method getRessourceBytes() allways returns
> null.
> I need the byte Array to fill a ImageObject of type
> org.apache.fop.render.afp.modca.ImageObject
>
> AFPDataStream afpStream= new AFPDataStream();
> afpStream.startDocument(out);
> afpStream.startPage(2970, 2100, 0);
> afpStream.createLine(1000, 0, 1000, 2000, 10, Color.BLACK);
>
> afpStream.endPage();
> afpStream.startPage(2970, 2100, 0);
> ImageObject imageObject=afpStream.getImageObject(0, 0, 1000, 1000);
>
> Can anybody give me a hint how I'm able to create a simple FopImage?
> And why the getRessourceBytes() allways returns null?
>
> I'm thankful for every Idea.
> Tobias
The URL should start with "file://", but I don't know if that will necessarily solve your problem.
Eric Amick Systems Engineer II
Legislative Computer Systems
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org