|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Embed Fonts in PDF using JavaHello,
I'm new here because I've got a problem I can't resolve by myself. I'm generating a PDF in Java using FOP. My PDF is generated perfectly - without embedded fonts. This is my Java-Code and my userconfig.xml: Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out); fopFactory.setStrictValidation(false); //config-Datei für Font-Embedding einbinden DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg = cfgBuilder.buildFromFile(new File(baseDir,"userconfig.xml")); fopFactory.setUserConfig(cfg); fopFactory.setFontBaseURL(baseDir.getAbsolutePath()+"/"); foUserAgent.setBaseURL("file://"+baseDir.getAbsolutePath()+"/"); <fonts> <auto-detect/> //absolute_path is a correct path within my system <font-triplet name="Arial Unicode MS" style="italic" weight="normal"/> <font-triplet name="Arial Unicode MS" style="normal" weight="normal"/> <font-triplet name="Arial Unicode MS" style="normal" weight="bold"/> </fonts> I'm using FOOP 0.95 and I've tried with Java 1.4 and 1.6. I've also tried with and without <font-base>-URL. No changes. Pathes are correctly because I can run it from command line without any problems, fonts will be embedded. I'm working on Ubuntu, could that be a problem? What else can it be? I've got no idea left, I've tried many things found in the internet. Can you please help me? Greetings, Breanna |
|
|
Re: Embed Fonts in PDF using JavaI resolved the problem by myself, but only with luck ...
The biggest problem was, that the java code lines below weren't positioned directly under the instantiation of the fopFactory. Then the fonts were discovered, but I get a outOfMemoryError, which I can resolve by adding -Xmx512m (more memory for the VM) to the java command. I didn't find any evidence to that solution, it was only luck that I discovered that fonts were integrated above these code lines. So I hope I can help some people with that.
|
|
|
Re: Embed Fonts in PDF using JavaI resolved the problem by myself, but only with luck ... The biggest problem was, that the java code lines below weren't positioned directly under the instantiation of the fopFactory. Then the fonts were discovered, but I get a outOfMemoryError, which I can resolve by adding -Xmx512m (more memory for the VM) to the java command. I didn't find any evidence to that solution, it was only luck that I discovered that fonts were integrated above these code lines. So I hope I can help some people with that. Breanna_Rin wrote: > > Hello, > > I'm new here because I've got a problem I can't resolve by myself. > I'm generating a PDF in Java using FOP. My PDF is generated perfectly - > without embedded fonts. This is my Java-Code and my userconfig.xml: > > > Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out); > fopFactory.setStrictValidation(false); > > //config-Datei für Font-Embedding einbinden > DefaultConfigurationBuilder cfgBuilder = new > DefaultConfigurationBuilder(); > Configuration cfg = cfgBuilder.buildFromFile(new > File(baseDir,"userconfig.xml")); > fopFactory.setUserConfig(cfg); > fopFactory.setFontBaseURL(baseDir.getAbsolutePath()+"/"); > foUserAgent.setBaseURL("file://"+baseDir.getAbsolutePath()+"/"); > > > <fonts> > <auto-detect/> > > //absolute_path is a correct path within my system > > <font-triplet name="Arial Unicode MS" style="italic" > weight="normal"/> > <font-triplet name="Arial Unicode MS" style="normal" > weight="normal"/> > <font-triplet name="Arial Unicode MS" style="normal" > weight="bold"/> > > </fonts> > > > I'm using FOOP 0.95 and I've tried with Java 1.4 and 1.6. I've also tried > with and without <font-base>-URL. No changes. > > Pathes are correctly because I can run it from command line without any > problems, fonts will be embedded. > > I'm working on Ubuntu, could that be a problem? > What else can it be? I've got no idea left, I've tried many things found > in the internet. Can you please help me? > > Greetings, > Breanna > -- View this message in context: http://www.nabble.com/Embed-Fonts-in-PDF-using-Java-tp26112969p26114832.html Sent from the FOP - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
| Free embeddable forum powered by Nabble | Forum Help |