Wikipedia:WikiProject Maps/PDF map conversion to SVG
Please see commons:Category:PDF maps. This is a tutorial in various formats. Some parts are in question-and-answer format, as in FAQs. Parts of this were copied and adapted from this discussion:
Before learning how to convert PDF images to SVG images it may be useful to learn how to extract images from PDF documents and create PNG, GIF, and JPG images. By using Adobe Reader many images in PDF documents can be right-clicked, copied, and then pasted into any image editor. A popular, free image editor good for beginners is IrfanView. Launch it and paste the image into it. Then use the image editor to save the image in any format. You can also select almost any area of a PDF document with Adobe Reader's cropping and selection tools, and then copy that selected area by right-clicking it. Then paste it into any image editor for conversion to other image formats. The PrintScreen key on your keyboard is a good last resort, too. Click that key, and then open an image editor and click "paste" (usually in the edit menu). Finally, Wikipedia:Graphic Lab/Image workshop can create, extract, or edit almost any image. Just leave a request for help or advice there.
Now here is some info on how to convert PDF image to SVG images. This page covers conversion using free tools. To convert using Adobe Illustrator go to the following two pages:
- Wikipedia:WikiProject Maps/PDF map conversion to SVG/Adobe Illustrator
- Wikipedia:Graphic Lab/Images to improve/Archive/Jul 2008#Image:APISmap1.pdf
It takes only a few seconds to convert a PDF to an SVG, using nothing but free software. Go Open Source! This tutorial assumes familiarity with installing programs and downloading, saving, opening and uploading files.
How to convert a PDF to SVG
[edit]- Download Inkscape 0.46 from www.inkscape.org
- Download the PDF you want to convert
- Run Inkscape
- Open the PDF file you want convert in Inkscape (not Acrobat)
- Click OK on the box that comes up
- Wait a little while as Inkscape converts it
- Click File>Save As..
- Click Save in the bottom right corner
- Done! You now have an SVG file with the same name as the PDF, but with the .svg extension
- Upload the SVG and check that it displays properly
If you can't see the SVG on Wikipedia/Commons
[edit]This should work for most PDF to SVG conversions, but if it doesn't there are some things you can do:
- Check that you have the 0.46 or later version of Inkscape. Earlier versions do not have PDF support.
- There may be compatibility problems between the Wikipedia / Media rendering engine and Inkscape:
- (This is a shameless ripoff of User:Phidauex/SVG tips)
- Select everything (Ctrl-A) and choose the Path>Object to Path command.
- Select everything (Ctrl-A) and choose the Path>Stroke to Path command.
- In the File>Save As.. dialog look for the drop-down menu just above the Save button and save as a Plain SVG.
- If that doesn't work, call your local friendly WikiGraphist at Wikipedia:Graphic Lab/Images to improve or Wikipedia talk:WikiProject Maps.
Basic navigation in Inkscape
[edit]I you want to take a look at your SVG in Inkscape hold Ctrl and scroll you mouse wheel forward and back to zoom in and out. Use the scroll-bars on the right and bottom to scroll.
Warning
[edit]Some PDFs create very "bad" SVG files when converted automatically. A "bad" SVG can be identified because it will convert slowly (more than 5 seconds), it will be very large for an SVG (over 1MB) and it will render very slowly on WP - there is a long wait while the text and other images on the page are loaded, but the SVG image does not show up. Bad SVGs put a lot of strain on the Wiki servers. If you suspect you have a "bad" file, go to a Wikigraphist for a manual conversion. These will almost always be much better than the automated versions in terms of being smaller, better drawn and easier to translate because the text is created properly.
For interest
[edit]Inkscape is FOSS software. Feel good about saving the planet from commercialism while converting! For additional comments see this discussion:
If you have comments about this tutorial or it doesn't work for you, please comment on the talk page.
It might be worth mentioning that this won't magically convert any raster graphics included in the document into vector graphics. This is excellent if the PDF has vector graphics, but not so useful if it has a photograph inside.
It can help you to extract the photo, but won't make it an SVG.
Can you clarify what a "PDF map" is, for this purpose?
[edit]I feel ignorant - but a quick wiki-search and Google-search did not enlighten me. I know how to put any graphic file into a pdf - but my strong hunch is that it takes more than this to make it a "pdf map"!
- Good Q. An example of a (vector) PDF map ready for conversion to SVG is this. PDFs can contain practically any type of information, the most common ones being text, raster images (ordinary images like bitmaps) and vector graphics. The vector information has to be coded into the PDF as such. Quite a lot of organizations publish vector information (like maps) this way, so it's handy to be able to convert out of PDF, but putting things into PDFs is pointless for us, it doesn't change the type. If you need a raster image converted, best to speak to a WikiGraphist - MissMJ is the resident pro and very approachable.