RE: FOP with embedded font running in Oracle 10g

2011-06-08 Thread Eric Douglas
I'm wondering that myself.  I tested loading in images when I first
started using it and had some issues with the path reference to get FOP
to find the image file.  I haven't gotten back to it.  That's on my to
do list.
My workaround was to load my image into a program which saved it as SVG
draw commands and I put it directly into my XSL.
Of course this means I can only use one image but that's all I needed
for now.
 
To load in custom fonts embedded in the jar I did this.

TTFFontLoader myTTFLoader;
MultiByteFont myCustomFont;
ArrayList myFontTriplets;
Object[] myFontFamilyNames;
String familyName;
String loadFontPath;
String loadFontFileName;
EmbedFontInfo myEmbedFontInfo;
FOUserAgent myUserAgent = createFOUserAgent();
InputStream is;
String fontFileURI;

AbstractRendererMaker myAbstractRendererMaker;
PDFRenderer myPDFRenderer;
RendererFactory myRendererFactory;

// Load Normal Font
loadFontPath = "/resources/";
loadFontFileName = "LTYPE.TTF";
is = getClass().getResourceAsStream(loadFontPath + loadFontFileName);
fontFileURI = DataURLUtil.createDataURL(is, null);
myTTFLoader = new TTFFontLoader(fontFileURI, new
DefaultFontResolver(myUserAgent));
myCustomFont = (MultiByteFont)myTTFLoader.getFont();
myFontTriplets = new ArrayList();
myFontFamilyNames = myCustomFont.getFamilyNames().toArray();
if (myFontFamilyNames.length < 1) {
 System.err.println("WARNING: Font " + loadFontPath +
loadFontFileName + " Cannot Find Font Families");
} else if (myFontFamilyNames.length > 1) {
 System.err.println("WARNING: Font " + loadFontPath +
loadFontFileName + " Contains Multiple Font Families");
} else {
 familyName = (String) (myFontFamilyNames[0]);
 myNormalFont = new FontTriplet(familyName, Font.STYLE_NORMAL,
myCustomFont.getWeight());
 myFontTriplets.add(myNormalFont);
}
myEmbedFontInfo = new EmbedFontInfo(null,
myCustomFont.isKerningEnabled(), myFontTriplets, fontFileURI, "");
myFontList.add(myEmbedFontInfo);
is.close();

// Setup custom renderer
myRendererFactory = myUserAgent.getRendererFactory();
myAbstractRendererMaker =
myRendererFactory.getRendererMaker(MimeConstants.MIME_PDF);
myPDFRenderer = (PDFRenderer)
(myAbstractRendererMaker.makeRenderer(myUserAgent));
myPDFRenderer.setUserAgent(myUserAgent);
myPDFRenderer.setFontList(myFontList);
myPDFRenderer.setupFontInfo(new FontInfo());
myUserAgent.setRendererOverride(myPDFRenderer);

-Original Message-
From: Flipz-007 [mailto:flipz-...@seznam.cz] 
Sent: Friday, June 03, 2011 6:31 PM
To: fop-users@xmlgraphics.apache.org
Subject: RE: FOP with embedded font running in Oracle 10g

Ok,
it sound great. Could you notice any example please?
I have also another question - is there any way how to register images
stored inside java archive? And then how to specify path in FO element
 ?
Small example would be very useful...
Thank you
Jiri


If you're using embedded code doing your own transform with all custom
fonts you can use FOP's FontLoader classes to manually load your own
fonts into the renderer.  It's a bit more complicated but it should run
faster than trying to find the font on the path.


-Original Message-----
From: Michael Rubin [mailto:mrubin@...]
Sent: Friday, June 03, 2011 6:38 AM
To: fop-users@...
Subject: Re: FOP with embedded font running in Oracle 10g

Ooh didn't know about that. Shows I'm still very new to FOP and learning
all the while... This sounds much better than my idea to
programmatically extract the font to a temporary location which may be
disregarded...

Thanks.

-Mike

On 03/06/11 11:33, Theresa Jayne Forster wrote:

> Are you just saying your Java App has to be able to access the font to

> create the PDF based on data from the database or are you saying you 
> have to store the ttf file inside the database?
>
> The former, just use  in the fopconfig.  With 1.0 it 
> searches the classpath (which includes your application Jar) to find 
> fonts, and you can also have external jar files containing the Fonts
as well.
>
> Auto-Detect and auto-embed feature
> When the "auto-detect" flag is set in the configuration, FOP will 
> automatically search for fonts in the default paths for your operating

> system.
> FOP will also auto-detect fonts which are available in the classpath, 
> if they are described as "application/x-font" in the MANIFEST.MF file.
> For example, if your .jar file contains font/myfont.ttf:
> Manifest-Version: 1.0
>Name: font/myfont.ttf
>Content-Type: application/x-font
>
> This feature allows you to create JAR files containing fonts. The JAR 
> files can be added to fop by providing them in the classpath, e.g.
> copying them into the lib/ directory.
>
> Kindest regards
>
>
> Theresa Forster
> Senior Software Developer
>
>
<  [hide part of

RE: FOP with embedded font running in Oracle 10g

2011-06-08 Thread Flipz-007
Ok,
it sound great. Could you notice any example please?
I have also another question - is there any way how to register images stored 
inside java archive? And then how to specify path in FO element 
 ?
Small example would be very useful...
Thank you
Jiri


If you're using embedded code doing your own transform with all custom fonts 
you can use FOP's FontLoader classes to manually load your own fonts into the 
renderer.  It's a bit more complicated but it should run faster than trying to 
find the font on the path.


-Original Message-
From: Michael Rubin [mailto:mrubin@...]
Sent: Friday, June 03, 2011 6:38 AM
To: fop-users@...
Subject: Re: FOP with embedded font running in Oracle 10g

Ooh didn't know about that. Shows I'm still very new to FOP and learning all 
the while... This sounds much better than my idea to programmatically extract 
the font to a temporary location which may be disregarded...

Thanks.

-Mike

On 03/06/11 11:33, Theresa Jayne Forster wrote:

> Are you just saying your Java App has to be able to access the font to
> create the PDF based on data from the database or are you saying you
> have to store the ttf file inside the database?
>
> The former, just use  in the fopconfig.  With 1.0 it
> searches the classpath (which includes your application Jar) to find
> fonts, and you can also have external jar files containing the Fonts as well.
>
> Auto-Detect and auto-embed feature
> When the "auto-detect" flag is set in the configuration, FOP will
> automatically search for fonts in the default paths for your operating
> system.
> FOP will also auto-detect fonts which are available in the classpath,
> if they are described as "application/x-font" in the MANIFEST.MF file.
> For example, if your .jar file contains font/myfont.ttf:
> Manifest-Version: 1.0
>Name: font/myfont.ttf
>Content-Type: application/x-font
>
> This feature allows you to create JAR files containing fonts. The JAR
> files can be added to fop by providing them in the classpath, e.g.
> copying them into the lib/ directory.
>
> Kindest regards
>
>
> Theresa Forster
> Senior Software Developer
>
>
«  [hide part of quote]



Michael Rubin
Developer

T: +44 20 8238 7400
F: +44 20 8238 7401

mrubin@...

The contents of this e-mail are intended for the named addressee only. It 
contains information that may be confidential. Unless you are the named 
addressee or an authorized designee, you may not copy or use it, or disclose it 
to anyone else. If you received it in error please notify us immediately and 
then destroy it.




-Original Message-----

> From: Flipz-007 [mailto:Flipz-007@...]
> Sent: 03 June 2011 10:04
> To: fop-users@...
> Subject: FOP with embedded font running in Oracle 10g
>
> Dear all,
>
> I need to create Java application which will generate PDF report from given
> data. This application needs to be run in Oracle DB 10g environment as a
> stored procedure.
>
> The main problem is that I don't know how to configure FOP to use my
> specific font which is embedded in application jar as a resource. In
> Internet there are many examples how to configure FOP if the font is located
> on filesystem, but in my case I need to load the font into DB inside my java
> archive.
>
> I searched through the Internet but I didn't find any solution.
> Could you give me any advice please?
> Thank you very much.
>
> Jiri
>
> -
> To unsubscribe, e-mail: fop-users-unsubscribe@...
> For additional commands, e-mail: fop-users-help@...
>
> -
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11
> Internal Virus Database is out of date.
>
>
>
> -
> To unsubscribe, e-mail: fop-users-unsubscribe@...
> For additional commands, e-mail: fop-users-help@...
>
«  [hide part of quote]


-
To unsubscribe, e-mail: fop-users-unsubscribe@...
For additional commands, e-mail: fop-users-help@...


-
To unsubscribe, e-mail: fop-users-unsubscribe@...
For additional commands, e-mail: fop-users-help@...

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



RE: FOP with embedded font running in Oracle 10g

2011-06-03 Thread Eric Douglas
If you're using embedded code doing your own transform with all custom fonts 
you can use FOP's FontLoader classes to manually load your own fonts into the 
renderer.  It's a bit more complicated but it should run faster than trying to 
find the font on the path.


-Original Message-
From: Michael Rubin [mailto:mru...@thunderhead.com] 
Sent: Friday, June 03, 2011 6:38 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: FOP with embedded font running in Oracle 10g

Ooh didn't know about that. Shows I'm still very new to FOP and learning all 
the while... This sounds much better than my idea to programmatically extract 
the font to a temporary location which may be disregarded...

Thanks.

-Mike

On 03/06/11 11:33, Theresa Jayne Forster wrote:
> Are you just saying your Java App has to be able to access the font to 
> create the PDF based on data from the database or are you saying you 
> have to store the ttf file inside the database?
>
> The former, just use  in the fopconfig.  With 1.0 it 
> searches the classpath (which includes your application Jar) to find 
> fonts, and you can also have external jar files containing the Fonts as well.
>
> Auto-Detect and auto-embed feature
> When the "auto-detect" flag is set in the configuration, FOP will 
> automatically search for fonts in the default paths for your operating 
> system.
> FOP will also auto-detect fonts which are available in the classpath, 
> if they are described as "application/x-font" in the MANIFEST.MF file. 
> For example, if your .jar file contains font/myfont.ttf:
> Manifest-Version: 1.0
>Name: font/myfont.ttf
>Content-Type: application/x-font
>
> This feature allows you to create JAR files containing fonts. The JAR 
> files can be added to fop by providing them in the classpath, e.g. 
> copying them into the lib/ directory.
>
> Kindest regards
>
>
> Theresa Forster
> Senior Software Developer
>
> 



Michael Rubin
Developer

T: +44 20 8238 7400
F: +44 20 8238 7401

mru...@thunderhead.com

The contents of this e-mail are intended for the named addressee only. It 
contains information that may be confidential. Unless you are the named 
addressee or an authorized designee, you may not copy or use it, or disclose it 
to anyone else. If you received it in error please notify us immediately and 
then destroy it. 




-Original Message-----
> From: Flipz-007 [mailto:flipz-...@seznam.cz]
> Sent: 03 June 2011 10:04
> To: fop-users@xmlgraphics.apache.org
> Subject: FOP with embedded font running in Oracle 10g
>
> Dear all,
>
> I need to create Java application which will generate PDF report from given
> data. This application needs to be run in Oracle DB 10g environment as a
> stored procedure.
>
> The main problem is that I don't know how to configure FOP to use my
> specific font which is embedded in application jar as a resource. In
> Internet there are many examples how to configure FOP if the font is located
> on filesystem, but in my case I need to load the font into DB inside my java
> archive.
>
> I searched through the Internet but I didn't find any solution.
> Could you give me any advice please?
> Thank you very much.
>
> Jiri
>
> -
> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
>
> -
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11
> Internal Virus Database is out of date.
>
>
>
> -
> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
>


-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org


-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: FOP with embedded font running in Oracle 10g

2011-06-03 Thread Michael Rubin
Ooh didn't know about that. Shows I'm still very new to FOP and learning 
all the while... This sounds much better than my idea to 
programmatically extract the font to a temporary location which may be 
disregarded...


Thanks.

-Mike

On 03/06/11 11:33, Theresa Jayne Forster wrote:

Are you just saying your Java App has to be able to access the font to
create the PDF based on data from the database or are you saying you have to
store the ttf file inside the database?

The former, just use  in the fopconfig.  With 1.0 it searches
the classpath (which includes your application Jar) to find fonts, and you
can also have external jar files containing the Fonts as well.

Auto-Detect and auto-embed feature
When the "auto-detect" flag is set in the configuration, FOP will
automatically search for fonts in the default paths for your operating
system.
FOP will also auto-detect fonts which are available in the classpath, if
they are described as "application/x-font" in the MANIFEST.MF file. For
example, if your .jar file contains font/myfont.ttf:
Manifest-Version: 1.0
   Name: font/myfont.ttf
   Content-Type: application/x-font

This feature allows you to create JAR files containing fonts. The JAR files
can be added to fop by providing them in the classpath, e.g. copying them
into the lib/ directory.

Kindest regards


Theresa Forster
Senior Software Developer






Michael Rubin
Developer

T: +44 20 8238 7400
F: +44 20 8238 7401

mru...@thunderhead.com

The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us 
immediately and then destroy it. 





-Original Message-

From: Flipz-007 [mailto:flipz-...@seznam.cz]
Sent: 03 June 2011 10:04
To: fop-users@xmlgraphics.apache.org
Subject: FOP with embedded font running in Oracle 10g

Dear all,

I need to create Java application which will generate PDF report from given
data. This application needs to be run in Oracle DB 10g environment as a
stored procedure.

The main problem is that I don't know how to configure FOP to use my
specific font which is embedded in application jar as a resource. In
Internet there are many examples how to configure FOP if the font is located
on filesystem, but in my case I need to load the font into DB inside my java
archive.

I searched through the Internet but I didn't find any solution.
Could you give me any advice please?
Thank you very much.

Jiri

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11
Internal Virus Database is out of date.



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org




-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



RE: FOP with embedded font running in Oracle 10g

2011-06-03 Thread Theresa Jayne Forster
Are you just saying your Java App has to be able to access the font to
create the PDF based on data from the database or are you saying you have to
store the ttf file inside the database?

The former, just use  in the fopconfig.  With 1.0 it searches
the classpath (which includes your application Jar) to find fonts, and you
can also have external jar files containing the Fonts as well.

Auto-Detect and auto-embed feature
When the "auto-detect" flag is set in the configuration, FOP will
automatically search for fonts in the default paths for your operating
system.
FOP will also auto-detect fonts which are available in the classpath, if
they are described as "application/x-font" in the MANIFEST.MF file. For
example, if your .jar file contains font/myfont.ttf:
Manifest-Version: 1.0
  Name: font/myfont.ttf
  Content-Type: application/x-font

This feature allows you to create JAR files containing fonts. The JAR files
can be added to fop by providing them in the classpath, e.g. copying them
into the lib/ directory.

Kindest regards


Theresa Forster
Senior Software Developer

-Original Message-
From: Flipz-007 [mailto:flipz-...@seznam.cz] 
Sent: 03 June 2011 10:04
To: fop-users@xmlgraphics.apache.org
Subject: FOP with embedded font running in Oracle 10g

Dear all,

I need to create Java application which will generate PDF report from given
data. This application needs to be run in Oracle DB 10g environment as a
stored procedure.

The main problem is that I don't know how to configure FOP to use my
specific font which is embedded in application jar as a resource. In
Internet there are many examples how to configure FOP if the font is located
on filesystem, but in my case I need to load the font into DB inside my java
archive.

I searched through the Internet but I didn't find any solution.
Could you give me any advice please?
Thank you very much.

Jiri

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11
Internal Virus Database is out of date.



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: FOP with embedded font running in Oracle 10g

2011-06-03 Thread Michael Rubin
One thought that comes to mind off the cuff: Since a jar file is a zip 
file, and java can extract files from a zip, could your java class 
extract the font to a temporary location on the file system, then update 
your xconf file to point to the font, then run FOP using the xconf file, 
and then afterwards remove the font from its temporary location to tidy up?


Thanks.

-Mike

On 03/06/11 10:03, Flipz-007 wrote:

Dear all,

I need to create Java application which will generate PDF report from given 
data. This application needs to be run in Oracle DB 10g environment as a stored 
procedure.

The main problem is that I don't know how to configure FOP to use my specific 
font which is embedded in application jar as a resource. In Internet there are 
many examples how to configure FOP if the font is located on filesystem, but in 
my case I need to load the font into DB inside my java archive.

I searched through the Internet but I didn't find any solution.
Could you give me any advice please?
Thank you very much.

Jiri

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org







Michael Rubin
Developer

T: +44 20 8238 7400
F: +44 20 8238 7401

mru...@thunderhead.com

The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us 
immediately and then destroy it. 






-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



FOP with embedded font running in Oracle 10g

2011-06-03 Thread Flipz-007
Dear all,

I need to create Java application which will generate PDF report from given 
data. This application needs to be run in Oracle DB 10g environment as a stored 
procedure.

The main problem is that I don't know how to configure FOP to use my specific 
font which is embedded in application jar as a resource. In Internet there are 
many examples how to configure FOP if the font is located on filesystem, but in 
my case I need to load the font into DB inside my java archive.

I searched through the Internet but I didn't find any solution.
Could you give me any advice please?
Thank you very much.

Jiri

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org