batik

Batik Incompatible object argument for function call

跟風遠走 提交于 2019-12-24 09:39:57
问题 I am seeing the following error while trying to load an svg document in to JSVG panel. Exception occurred in target VM: (class: org/apache/batik/bridge/BridgeContext, method: dispose signature: ()V) Incompatible object argument for function call java.lang.VerifyError: (class: org/apache/batik/bridge/BridgeContext, method: dispose signature: ()V) Incompatible object argument for function call at org.apache.batik.swing.svg.JSVGComponent.createBridgeContext(Unknown Source) at org.apache.batik

Infinite scan for fonts in Apache FOP on CentOS

不想你离开。 提交于 2019-12-24 07:16:07
问题 I use Apache Batik to convert SVG into PDF in one of the projects. The project is Spring application running in Tomcat 7. Everything works OK on development machine which runs under Ubuntu with Tomcat being started using $CATALINA_HOME/bin/startup.sh. But when I try to run the app on production server with CentOS 6 and Tomcat started using service tomcat7 start command the app falls into infinite loop on convertation. I've tried to debug the problem and found this piece of code: /** * Creates

Requested: https://www.w3.org/2000/svg Found: http://www.w3.org/2000/svg [duplicate]

ε祈祈猫儿з 提交于 2019-12-23 09:41:54
问题 This question already has an answer here : XML Namespace URI with HTTPS? (1 answer) Closed 2 years ago . We are using Apache Batik to render SVG files. For security reasons, all the URLs are converted to HTTP. Now, when we are rendering the SVG files, we get this issue. Original SVG is: svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" Converted SVG is: svg xmlns=\"https://www.w3.org/2000/svg\" xmlns:xlink=\"https://www.w3.org/1999/xlink\" So, I tried with

How to convert SVG Path (SVGOMPathElement) to array of points? [duplicate]

梦想与她 提交于 2019-12-23 03:07:43
问题 This question already has an answer here : How to load and parse SVG documents (1 answer) Closed 9 months ago . What I'm trying to do: convert an SVG path to an array of (x,y) points. I have this at the moment: public Point[] strokeToPoints(Node n){ SVGOMPathElement path = (SVGOMPathElement) n; System.out.println(path.getAttribute("d")); System.out.println(path.getTotalLength()); return null; } Node n is always a path element extracted from an SVG file which looks something like this: <path

Batik with grails giving sax clash

╄→尐↘猪︶ㄣ 提交于 2019-12-22 07:51:19
问题 I'm trying to use batik with grails to render some SVG stuff to PNG on the server. I'm getting the following error in IntelliJ when I add the dependencies to BuildConfig and then tell IntelliJ to load the changes: /Library/Java/JavaVirtualMachines/1.6.0_33-b03-424.jdk/Contents/Home/bin/java -Dgrails.home=/Applications/Dev/grails-2.1.0 -Dbase.dir=/Users/greg/Documents/development/git/liftyourgame-grails/webapp -Dtools.jar=/Library/Java/JavaVirtualMachines/1.6.0_33-b03-424.jdk/Contents/Home/lib

create an SVG image with embedded base64 string from another svg image with elements

旧城冷巷雨未停 提交于 2019-12-19 03:39:16
问题 I have an SVG file that contains several elements (like path, circles, rectangles, etc.). I'd like to convert that SVG file to an SVG with embedded base64 data instead of multiple elements. is it possible to do that with Batik? The project I'm working on requires I use Java libraries only. 回答1: There's a technique which I've used to embed SVG images in Blogger posts which might work for this. Basically, it's a two-step process: You serialize the SVG you want to embed, and URL-encode it. You

Unregister font with GraphicsEnvironment?

房东的猫 提交于 2019-12-19 02:52:11
问题 I recently found out how to register a TTF font with the local GraphicsEnvironment, s.t., for my use case (SVG-to-PNG transcoding), Apache Batik may recognize the font: import java.awt.Font; import java.awt.FontFormatException; import java.awt.GraphicsEnvironment; // [...] GraphicsEnvironment lge = GraphicsEnvironment.getLocalGraphicsEnvironment(); try { Font font = Font.createFont(Font.TRUETYPE_FONT, fontFile); lge.registerFont(font); } catch (FontFormatException e) { logger.warn(e

jQuery ajax seems to alter SVG data sent to coldfusion server

社会主义新天地 提交于 2019-12-18 09:22:50
问题 I'm using $.ajax() to send a string to a coldfusion server where it is stored in a table. When I later query and try to use that data I get an error; "null Enclosed Exception: Invalid byte 2 of 3-byte UTF-8 sequence". First I grab the SVG from the DOM and send it to an action page. It should just be a string, right? var lclSVG = $('#myDiv')[0].innerHTML; // SVG Code (XML?) $.ajax({ url: "myAction.cfm", type: "POST", data: ({myInfo: lclSVG}), }); On the myAction.cfm page I update the data into

How to get a BufferedImage from a SVG?

断了今生、忘了曾经 提交于 2019-12-17 15:44:22
问题 I am using Batik to handle SVG images. Is there any way to get a java.awt.image.BufferedImage from a SVG-file? I know there are transcoders, with which I could transcode the SVG into, for example, a PNG and then load that PNG with ImageIO.read()· But I don't want to have the temporary file. 回答1: Using Batik, something like this: public static BufferedImage rasterize(File svgFile) throws IOException { final BufferedImage[] imagePointer = new BufferedImage[1]; // Rendering hints can't be set

convert pdf to svg

笑着哭i 提交于 2019-12-17 10:12:06
问题 I want to convert PDF to SVG please suggest some libraries/executable that will be able to do this efficiently. I have written my own java program using the apache PDFBox and Batik libraries - PDDocument document = PDDocument.load( pdfFile ); DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation(); // Create an instance of org.w3c.dom.Document. String svgNS = "http://www.w3.org/2000/svg"; Document svgDocument = domImpl.createDocument(svgNS, "svg", null);