What we need to do:
- Enable WSL on Windows 10.
- Install Ubuntu (latest version) on WSL from the Windows Store.
- Install poppler-utils Command-line tool on WSL.
- Convert PDF file to an SVG file using pdftocairo tool, contained into poppler-utils.
- Use Inkspace to ungroup, copy, paste the desired vector graphic to a new SVG file.
- Use Illustrator to export that graphic as an SVG image.
Open Ubuntu command-line, and run the following commands:
sudo apt-get update
sudo apt-get upgrade
sudo apt install poppler-utils
Now poppler-utils should have been installed successfully on WSL. To check the currently installed version of poppler-utils run pdftocairo -v
in the Ubuntu Command-line.
If it returns a version, Congratulations! you have successfully installed poppler-utils on WSL.
Now, copy the desired PDF file to the WSL directory to convert it into an SVG file. To open the current WSL directory in the Windows Explorer, run explorer.exe .
from the Ubuntu Command-line.
After that, run the following command from the Ubuntu Command-line to convert a PDF file into an SVG file.
# syntax
pdftocairo [options] <PDF-file> [<output-file>]
# example
pdftocairo -svg input-file-name.pdf output-file-name.svg
The above example command should create a output-file-name.svg file from input-file-name.pdf file.
After that:
- Open the newly created SVG file into the Inkspace program.
- Right-click the vector graphic and click "Ungroup" from the pop-up menu. This splits the image up into its vector components so you can extract the parts you require.
- Click and drag your cursor over the part of the image you want to extract. Once you release the mouse button, the selected image will have bounding boxes with scale/rotation handles around it.
- Right-click the selected image and click "Copy." Click "File," then "New," then "Default" and click "Edit" and "Paste" to extract the vector graphic from the SVG file to the new document.
- Click and drag the vector image into position on the blank page. Use the scale handles around the image to enlarge it to the dimensions that you prefer.
- Click "File" and "Save" and type a name for the vector file. Select "SVG" as the "Save as type" to store the file in a vector format.
- After that, use Adobe Illustrator to export that graphic as an SVG file.
- https://stackoverflow.com/questions/18381713/how-to-install-poppler-on-windows
- https://superuser.com/questions/1338991/how-to-open-windows-explorer-from-current-working-directory-of-wsl-shell
- https://stackoverflow.com/questions/12084742/extracting-vector-graphics-from-pdf-with-inkscape
- https://www.makeuseof.com/tag/extract-images-pdf-files-save-windows/
- https://smallbusiness.chron.com/extract-vector-graphic-pdf-47224.html