batik

How I use a custom font with the Batik SVG library?

喜欢而已 提交于 2020-08-01 05:03:45
问题 I'm working on a Java program which creates templates for clothes. The user enters the word they want to see on the item of clothing and the system creates a PDF template. To create the template I create an SVG document programatically then use Batik to transcode the SVG to the PDF format. My client now wants to be able to use custom fonts to create the templates. I was wondering if it's possible to use fonts like a TTF with the Batik transcoder? If so how do you go about setting up the SVG?

How I use a custom font with the Batik SVG library?

点点圈 提交于 2020-08-01 05:03:31
问题 I'm working on a Java program which creates templates for clothes. The user enters the word they want to see on the item of clothing and the system creates a PDF template. To create the template I create an SVG document programatically then use Batik to transcode the SVG to the PDF format. My client now wants to be able to use custom fonts to create the templates. I was wondering if it's possible to use fonts like a TTF with the Batik transcoder? If so how do you go about setting up the SVG?

java.lang.NoClassDefFoundError: org.apache.batik.dom.svg.SVGDOMImplementation

倖福魔咒の 提交于 2020-04-14 08:14:32
问题 I'm having weird trouble with Apache Batik library linked to my Android&LibGDX project. But let's start from beginning, in IntelliJ Idea I have a project which contains three modules: Main, Android and Desktop. "batik" library which I highlighted contains: And there is some code in "Main" module which is used in Android&Desktop modules: String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(parser); Following code is used to

Having problems with Apache Batik library on AWS ElasticBeanstalk Instance

南笙酒味 提交于 2020-01-14 18:45:15
问题 I am using AWS Elasti Beanstalk to power one of my apps. In this I need to export a svg document to png,jpg, pdf etc. For this I use Apache Batik library. This provides excellent output on my local dev workstation but as soon as I deploy it on the EBS I start getting errors, all related to fonts. The error stacktrace was - Caused by: java.lang.Error: Probable fatal error:No fonts found. at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1088) at sun.font.FontManager

Generating PDF with iText and batik

倖福魔咒の 提交于 2020-01-14 02:30:14
问题 I'm trying to export text and SVG graphs to a PDF. I found out that iText and batik can do this. So I tried doing that, but everytime I put in a graph, it would become extraordinary small. I thought it might be something with my code, so I figured I would try an examplecode from Vaadin. public class PdfExportDemo { private String fontDirectory = null; private final String baseFont = "Arial"; private PdfWriter writer; private Document document; private Font captionFont; private Font normalFont

SVG line not getting rendered properly in PDF

我的未来我决定 提交于 2020-01-02 11:02:14
问题 I am using iText and some SVG rendering library. I want to render a SVG image to PDF. I am using following code to do that. Now the problem is I am giving an area chart SVG to it, it is not rendering line properly. Attaching screenshots. Following classes has been used: import org.apache.batik.bridge.BridgeContext; import org.apache.batik.bridge.DocumentLoader; import org.apache.batik.bridge.GVTBuilder; import org.apache.batik.bridge.UserAgent; import org.apache.batik.bridge.UserAgentAdapter;

SVG line not getting rendered properly in PDF

a 夏天 提交于 2020-01-02 11:01:30
问题 I am using iText and some SVG rendering library. I want to render a SVG image to PDF. I am using following code to do that. Now the problem is I am giving an area chart SVG to it, it is not rendering line properly. Attaching screenshots. Following classes has been used: import org.apache.batik.bridge.BridgeContext; import org.apache.batik.bridge.DocumentLoader; import org.apache.batik.bridge.GVTBuilder; import org.apache.batik.bridge.UserAgent; import org.apache.batik.bridge.UserAgentAdapter;

How to resize an svg (with batik) and display it?

a 夏天 提交于 2020-01-01 12:13:14
问题 I have a svg file of 100x100 pixels (for example). I am using Batik. If I do a : JSVGCanvas svg = new JSVGCanvas(); [...] svg.setSize(10,10); It will only show this part of the picture and not the resized image. Do you know how I can display a resized svg picture ? Thanks ;) 回答1: You need to ensure that the document you are displaying has a viewBox="" attribute set on its root <svg> element. For example, specifying viewBox="100 100 300 200" indicates that the region (100,100)→(400,300) will

How to resize an svg (with batik) and display it?

◇◆丶佛笑我妖孽 提交于 2020-01-01 12:12:11
问题 I have a svg file of 100x100 pixels (for example). I am using Batik. If I do a : JSVGCanvas svg = new JSVGCanvas(); [...] svg.setSize(10,10); It will only show this part of the picture and not the resized image. Do you know how I can display a resized svg picture ? Thanks ;) 回答1: You need to ensure that the document you are displaying has a viewBox="" attribute set on its root <svg> element. For example, specifying viewBox="100 100 300 200" indicates that the region (100,100)→(400,300) will

grails 2.3 java.lang.NoClassDefFoundError: org/apache/batik/dom/svg/SVGOMDocument

牧云@^-^@ 提交于 2019-12-24 14:31:10
问题 When i run my grails application in tomcat i get the following error java.lang.NoClassDefFoundError: org/apache/batik/dom/svg/SVGOMDocument . But the batik-svg-dom.1.7.jar is packaged in the war and in the classpath. I don't however get this error when i am running the application in debug mode in STS. I am using Grails 2.3 and building my war using maven. I am using FOP and have excluded the "xml-apis". I have tried to place the batik-svg-dom.jar in the lib folder of tomcat, that did not