iText inline svg not locate by coordinates - java

I've been trying to use batik and iText to create a PDF in my application containing an SVG graph, however I only seem to be able to find examples where the svg is located at some coordinates. I don't want to have the image located at some coordinates however, I'm wanting it to be put into the page, preferably fit to the width of the page depending on whether it is landscape or portrait and be inline with any other content that I might add, have everything wrap around it.
Is this possible? I'm beginning to suspect my wish that somewhere it will start behaving like HTML is going to be in vain.
Many thanks,
Andrew
p.s.I have a working JAVA class to place the SVG on the page as a template, as per this tutorial:
http://itextpdf.com/examples/iia.php?id=263
p.p.s.For people looking for this issue in relation to Vaadin Charts I've tagged the question as Vaadin related also, as that's what has generated my SVG.

Related

Convert svg to some image format in java

assuming i have well formatted svg file - i use foreignObjects and all sorts of things in it - can i have some java code that lets me input the svg string, and gets out an image file of some sort?
Alternatively, gives me a pdf? I'm not really bothered as to the output format so much as just want some simple code that transforms svg to an image.
I know there are things like batik but I cannot work out how to tie it all together.
Apache Batik is probably the best renderer for Java. I'm assuming you meant a regular Java application and not Android.
However Batik doesn't support <foreignObject> though. It would need to include a complete HTML rendering engine to for that.
To support both SVG and HTML, you would need to embed a complete browser engine. For example Headless Chrome.

What's the best way to save PowerPoint slides as images

I'm trying to find a way to copy the whole slide, and paste it with the formatting of 'as an image' to a blank slide, using POI's APIs.
The reason why I'm trying to do this is because I want to save each slide as an image.
The POI's Slide.draw() API by itself does not do a very good job of saving the slides' contents to images.
For example it cannot draw the following two types of objects:
Tables created on PowerPoint
Charts pasted from Excel
Is there any way to 'copy' and 'paste with formatting (as an image)' via POI, just like you do these two operations on MS PowerPoint running on a Windows, in order to save the slides as they are?
Since Slide.draw() works just fine with images, once I paste all the objects as a single flat image onto a slide (using POI), I'll be good to go.
Or if there is a better way to save the slides contents as intact as possible, could you please let me know?
The license which comes along with the method needs to be Apache license or otherwise something more permissive.
Also, I read the following post:
Programmatically extracting slides as images from a PowerPoint presentation (.PPT)
unoconv is GPL-licensed, so it is not an option for us.
JODConverter is LGPL-licensed; I'm not sure if it's acceptable so I will talk to my boss and check.
Then I ran the POI as a command line tool, as suggested by Michael,
but I ended up getting the same problem (tables and pasted Excel charts
do not show up in the saved images.)
Thanks.

Exporting labels in a pdf

I am managing a java web application and I want to make a pdf export that contains some labels with a logo on them and some data like “id”.
What is the best way to do that.
I am thinking something like iText (I am not only intresting in html to pdf converter) but I am not sure if I can include images and borders in my tickets.
Every proposal is welcome.
If what you want is create from scratch PDF files that contain images and text, then yes, iText can do that (and much much more). Edit your question with further details about your requirements if a more detailed answer.

Extracting the outline (or bookmarks) from PDF files using Java

I'm using PDFBox to extract the outline (bookmarks) information from PDF files, that's even explained in the same site.
However, I've had problems not extracting but generating the qualified urls (foo.pdf#page=22777&zoom=2,2,777) to open the PDF in those bookmarks. Sometimes PDFBox is not able to find the page in which the bookmark is placed (i.e. the page number, left coordinate or top coordinate are wrong.)
Anyone knows a PDF library capable to do this (preferably in Java)? Thanks.
Best regards,
Alexander.
iText (http://itextpdf.com) might work for you.
I've used it mostly to create PDFs (not so much with parsing already exitingones), but the library is good, and does have objects related to outlines and bookmarks.

How to get internal content of jsf component?

I have a component's library and this library has Chart component. Chart is actually a jpg image.
I need to access this image. I need some basic tips where to search that image, maybe with examples based on some wellknown libraries like Tomahawk.
You could try using something like jQuery to help you acess the html page's dom structure after the page is rendered via javascript. Getting the image will be as simple as looking up a component by Id

Categories