extract vector image from a pdf file [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
Is there a command line tool on linux that would extract figures from a pdf file, and save them in vector format? I know about pdfimages, but that would create a bitmap, and that is not what I need.

not for images only, as you seem to need, but
pdftocairo
http://poppler.freedesktop.org/
http://www.manpagez.com/man/1/pdftocairo/ (manpage)
is able to render a pdf page to other vector formats like PS/EPS/SVG
assuming you have a pdf page with vectorized images, you can render this page to svg and then copy only image you are interested in
note: pdftocairo cannot render multipage pdf to multipage svg
if you need to convert to svg several pdf pages you need first to pick this page range and then burst pdf pages into single pdf pages
example (if we need to convert pages 1-10 of a pdf file to svg)
1°
pdftk file.pdf cat 1-10 output 1-10.pdf
2°
pdftk 1-10.pdf burst
3°
for f in *.pdf; do pdftocairo -svg $f; done
4°
finally, with sodipodi or inkscape, you can extract images you are interested from svg rendered pdf page

What do you consider a "figure"? This is a concept that doesn't exist in PDF. The reason there are so many tools that can extract images from a PDF file, is because images are a very clearly identified entity.
Your "figures" however, are much less clearly defined. PDF files may contain lots of vector content that you wouldn't call a figure. Text can be stroked for example, which would make it vector art and as such it might be confused with your figures. Other decorative elements may be used in the background of the pages. Text may be underlined, which would be a vector element...
In the other direction, your "figure" may contain a caption that is text, further complicating things.
As PDF doesn't have the notion of a figure, you'll have to figure out how to isolate one on a PDF page (perhaps because the creator application always adds metadata to them, or because they use a special color or... If you can isolate them, it should be possible to trim everything irrelevant on the page and export what you need as EPS or SVG using some of the techniques described in the other answer.

This article describes the tools gpdfx, inkscape and pdf2svg which are not completely commandline-based, but still sound helpful.

Related

Absolute Positioning of Text in a Dynamically Sized SVG

I have an SVG graphic that I want to put some text on from my PHP variables. The graphic was generated in Illustrator and resizes in my web page to 100% width. Here is a representation of it:
How could this be done for the 8 text items? Does something special need to be done in Illustrator, like creating an anchor point for the text? How do I update the text item? I've done research but haven't been able to find a similar situation.
Thankful for any information that could help me narrow down my search.
Being someone who has never worked with files of .SVG file type before, this was a misunderstanding.
If you design a graphic in Adobe Illustrator, save it as an SVG and edit it with your favorite text editor, you will be able to see the SVG mark-up. It all makes sense now, and here you will be able to change the text at the code-level.
For my application, I saved the SVG as a PHP file and did an include on it, while changing the raw text to PHP variables in said file. This allowed me to pass my dynamic text as variables to the graphic.

Exporting Illustrator to SVG, Colours, Gradients and Opacity wrongly displayed

I'm having trouble creating an SVG (for web use) from an illustrator file sent by the design agency. The SVG exported doesn't look like the same, specially because the affected areas are suppose to look like shadowed areas of human characters. The art created is quite complex and I'm not authorised to show it, but I'm just putting here one of the elements that replicates the issue.
original .ai file + exported .svg in this zip: http://we.tl/AdJPqFqQd1
I've also saved it in .eps and tried exporting, but it didn't make a difference
I'm looking for a solution that wouldn't be too hurtful considering that there are many elements in the original artwork like this shape and most of them have different colours and shapes.
I tried to access the CSS within the SVG but I couldn't manage to change the gradient.
Using Illustrator CC 2015 I've tried exporting with all the different options (unless I missed some special combination, which I do not believe)
Hopefully and with a lot of luck, I would like to find someone who came across this problem before and knows how to deal with it. If you could try it yourself, you would be aware of this issue and I would appreciate it very much. Thanks

Visio - Convert ".svg" to ".emf" format

My goal is to convert pictures from .svg format into .emf, remaining the size, resolution, etc!!
The best solution that I found was using Visio, because of the quality after conversion and also if I need to resize the pictures, they don’t lose quality.
Please check the picture that I am sending on the link.
This picture shows the appearance when I open a .svg file in Visio 2010. As you can see, the image is very clear and the limits well defined!
(picture. 1)
I have already fit the drawing to the page using this tip
(picture. 2)
To get the emf format I save this file as .emf format:
(picture. 3)
The quality is good when it is opened with Microsoft Picture Manager, but the problem is detectable when this picture is inserted on the software that I want to use. The .emf file looks well, but when I convert from svg to .emf, Visio inserts an invisible frame around the image, if I open this emf file with paint it looks like it is inserted 1 pixel size for all borders!
(picture. 4)
As you can see here, the size image from Visio should looks like this (Inkscape) but it’s inserted a frame like this:
(picture. 5)
(picture. 6)
Does anybody know how to get a solution to this, using either Visio or other software?
Please do the download of the files.
(Link is no longer valid.)
I appreciate all feedback.
Thank you for preparing so much for this question and providing the ZIP. It was a very thorough job.
I don't have definitive knowledge here but my experience is this is very common EMF which - as I understand it always require a bounding box to be stored in the file.
The only option I can think of is using another format for example EPS - but it depends on what the final program you are using supports. Exporting to a bitmap format works better for some applications - though it may not be desirable for your needs.
One solution would be to use inkscape to convert from svg to emf.
In the Inkscape GUI: Menu File -> Save As -> Select emf as Target
Or in the command line mode: inkscape -z src.svg -M target.emf

Any example of SVG used on (popular) sites?

I am evaluating the use of SVG for a website I'm working on, and I'd like to see some examples of pages using it effectively. I don't mean a "Sample SVG page" or specific parts like showing chars, but any well done site (not specifically about SVG) that conveys a good graphics experience through the employment of SVG for some or all of its graphics, as an alternative to styling it with PNG/GIF etc.
This question isn't really about programming, so is likely to get closed. Anyway here are a couple of examples:
http://www.uefa.com/uefaeuro/season=2012/tournament-calendar/index.html
http://hitmo-studio.com
http://beta.visualize.yahoo.com/core/
http://evolutionofweb.appspot.com/
http://www.wheredidmytaxdollarsgo.com/

How to properly use decorative fonts on a web page

I'd like to try some decorative fonts for a web site, like this one (just as an example):
http://www.dafont.com/nymphette.font
As usual, for the web one must verify the format compatibility of the font and licensing - no problem with that. The question is relative to the proper integration in a page without side effects. As you can see in the character table, decorations are mapped to regular characters - e.g 'A'. Let's suppose I want to use the decoration mapped to A; if the web page is consumed on a browser which doesn't support external fonts, of when the font is not downloaded yet, the decoration would be rendered as 'A', and it's confusing; a browser with accessibility support would probably speak the letter out loud, etc...
How to avoid that?
Thanks.
PS Of course it appear simpler to use plain image decorations. My question is not related to solving a problem, rather to experiment with this approach and understand how workable is.
** Update: I clarify that I know how to embed fonts in CSS, and I'm already using some "regular" (alphabetic) fonts from Google. The difference between alphabetic fonts and decorative fonts is that clearly you encode readable text with the former ones; you can minimize inconveniences during the loading by specifying fallback such as "serif", etc... With decorative fonts, you're using characters to represent graphics, hence my doubts.
You can embed fonts in your CSS.
You might also want to look into the Google Font API if you want some Google fonts with no learning curve.

Resources