Batik Rasterizer logo watermark remove from genereated image - java

Anyone know how to remove the Batik logo from the generated images? I'm trying the examples on their page http://xmlgraphics.apache.org/batik/tools/rasterizer.html
This is the source svg image https://bitbucket.org/llythiumn/cmput206/src/912d7681375d/batik-1.7/samples/barChart.svg?at=Ian2
This is the Java line I'm running to convert the svg to a png image
java -jar batik-rasterizer.jar -m image/png samples/barChart.svg
And this is what the generated image looks like with the logo at the bottom
http://svn.apache.org/repos/asf/xmlgraphics/batik/tags/batik-1_0beta2/test-references/samples/barChart.png
Perhaps its simple but I just can't find the option to remove it. Any suggestions would be appreciated.

The watermark is in the source image. If you don't supply a source image with a watermark you won't get one in the output.

Found it. I guess I should have tested it with svg files other than the ones batik provided. It seems that the Batik SVG examples come with a tag that forces the logo watermark. But it only does it when generating the image. Opening the svg image in a browser doesn't show the logo.
I tried it with other svg files from here and it worked fine. http://dev.w3.org/SVG/tools/svgweb/samples/svg-files

Related

How to convert SVG text to SVG paths?

I have SVG file (created by com.spire.pdf) and this SVG created from pdf file (pdf file created from html using iText lib).
So i need to convert this SVG to SVG with another tags(path), or SVG to PDF.
All tags in my example is like this: <text style="fill:#000000;font-family:Arial;font-weight:bold;" font-size="10" x="36" y="46.21002" letter-spacing="-0.075">2020</text>
I'm find lib, where it's possible to convert (inkscape) where i can by this paramether --export-text-to-path made my SVG file unable to select text.
The final goal i`m need PDF file where unposible to select text from there. (like it was created from image).
There is ways to convert SVG "text" file to SVG "image" file or to pdf?
Inkscape not good for me as i want to do it in java code (Spring boot app)
For now, I’m find only one lib where it's possible to do: inkscape with --export-text-to-path param.
Inkscape work in few threads, and can be runned from java. Convertions are slow, and size of exported files depends of version of inkscape.

how can i check color profile (CMYK or RGB) in PDF file using itext library

I'm working on an e-learning project. I have the pdf file's and I have to do the validation, that is pdf file contain the RGB/CMYK color profile or not.
If color profile is found RGB that is require to reject the file. I have tried so much but did not get appropriate logic/answer.
If anyone has any idea that how can i do this in itext or other java pdf library. please suggest me.
iText is for producing PDF files programmatically (e.g. converting from HTML to PDF, or producing PDF reports.) - it is only for producing, not for rendering, so you can't use it to check color.
In order to check color of a pixel in the PDF document
you need to render it to a BufferedImage or so, and then take the color of pixel in specific (x,y) position.
To render PDF you could use a library like ICEpdf, jpedal.
There is a topic on SO about java pdf renderer libraries Java PDF Renderer

SVG markup in PDF as generated from Jasper Reports

Problem Statement
I have a SVG markup sent from front end javascript to back-end action classes. I am using Jasper Reports to generate PDF which will contain the SVG image( i have markup data only). How do i do that.
What i have tried
I have tried to embed SVG image( having the link to image file) to the PDF file while generating reports.
Looking for
How to embed svg markup so that i can see the image in PDF. Any other best approach to solve it.
In later versions of jasper reports you no longer need to add class="net.sf.jasperreports.engine.JRRenderable" to the imageExpression.
It is the default in JasperReports 6+ and JasperSoftStudio (JSS) will remove it if you add it in the Source pane.
The Tomcat SVG file provided in the JasperSoft Community answer works nicely. My own SVG file would show properly in MS Edge or Chrome but didn't appear in JSS.
When I added width, height, viewbox and overflow attributes to the svg element, it then did appear in JSS - so try the example first before trying the svg you actually want.
According to their own web site (here: http://community.jaspersoft.com/wiki/how-add-svg-image-your-report-jrxml) you need to include the SVG using a special HTML element:
<imageExpression class="net.sf.jasperreports.engine.JRRenderable">
<![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstance(new java.io.File("D:\\tomcat.svg"))]]>
</imageExpression>
As the question indicates the absence of a SVG markup file, you could stick to the answer by David van Driessche but use a different getter:
BatikRenderer.getInstanceFromText($P{svgMarkup}) for example where svgMarkup is a parameter of String type containing the SVG markup data.

Batik - Convert HTML, CSS & SVG into an image

We can successfully convert an SVG into an image with Batik, however, I need to convert a whole HTML Div, with SVG implemented within, along with its CSS presentation code, into an image.
Are there any modules / support within Batik for achieving this? Here is a screenshot of
HTML, CSS & SVG which needs to be end output.
Thanks,

When printing PDF Document from Java, some of the text is rotated

I tried to print a PDF document from Java using PDFRenderer and ICEpdf.
In both cases some of the text came out rotated in 180 degrees while the images stayed correct.
With PDFREndere all the text is rotated and in ICEpdf only some of the lines.
Any idea why is this happening?
Sounds like a bug in pdf renderer. Have you tried their bug tracker? https://pdf-renderer.dev.java.net/servlets/ProjectIssues
Perhaps the pdf is broken. Also try to open the pdf using Ghostscript. Acrobat is too indulgent with broken or malformed pdf files (it automatically correct some "syntax" error in the pdf structure).
Sounds like the font you are using in the document isn't available on the system. I had the very same problem with java-generated eps files.

Categories