Convert SVG to PDF on several sheets

5,488

Solution 1

Have you tried the pdfposter package? From the project's website: "Pdfposter can be used to create a large poster by building it from multiple pages and/or printing it on large media. It expects as input a PDF file, normally printing on a single page. The output is again a PDF file, maybe containing multiple pages together building the poster. The input page will be scaled to obtain the desired size."

I tried a quick example from the man page: pdfposter -mA3 -pA0 askUbuntu.pdf printer-pages.pdf with your sample file (which I converted to PDF in Inkscape), and it seems to work : 6 A3 pages that need to be set in a 2×3 grid.

Solution 2

You can save as the image as pdf from inkscape directly using the highest resolution (dpi), say 600, of the printer you plan to use for printing.

Afterwards, you can use imagemagick (command convert) to crop the upper and lower parts of the image independently into two different pdf files. For instance (typed on a terminal):

convert askUbuntu.pdf -crop 100%x50% +repage askUbuntuSplit.pdf

You can then split it into individual pdf files using:

pdftk filename.pdf burst

I presume imagemagick and pdftk are already installed.

Share:
5,488

Related videos on Youtube

MadMike
Author by

MadMike

Updated on September 18, 2022

Comments

  • MadMike
    MadMike almost 2 years

    I have a SVG file created in Inkscape. I want to print it on multiple sheets to finally form a big poster. I need these multiple sheets converted to a PDF so I can print it from any operating system.

    The file I'm working with:

    • SVG has a size of 840 mm x 297 mm. (width x height)
    • Generate a PDF with two A3 sheets (420 mm x 297 mm).

    You can download the file if you want to try out your solution yourself.

    I'm open to almost any solution, be it Inkscape extensions/scripts or command-line tools. I just don't want to mess around manually each time I have to re-do the conversion.

    Things I've tried and didn't work:

    • inkscape-pages adds support for multiple pages to Inkscape, but no support to separate a given file to the pages.

    Tools which will only work with raster image format (like PNG or JPG) are a no-go:

    Tools I have heard that might work but where I'm unsure if they will and how to approach them:

    Update: Added download link.

    • user.dz
      user.dz over 9 years
      @MadMike, Could you mention your current work flow? (ie How are you doing it manually?)
    • MadMike
      MadMike over 9 years
      @Sneetsher I have a oversized (2 x A3) SVG file. I would like to convert it in a format (like PDF) that I can transport to work and print it from there. At work I will only have Windows available. Right now it's not a question of doing it manually or not, but how to do it at all.
  • Harris
    Harris over 9 years
    You can also try the following options to avoid the image getting rasterized: -density 600 -define psd:fit-page=2338x -resize 2338x
  • MadMike
    MadMike over 9 years
    convert banner_eingang5.svg -density 600 -define psd:fit-page=2338x -resize 2338x -crop 50%x100% +repage filename.pdf I get a rasterized pdf with a size of 49x35mm (way to small)
  • Harris
    Harris over 9 years
    Does this give you a rasterized pdf: convert -density 90 askUbuntu.svg -crop 50%x100% +repage -trim -background black askUbuntu.pdf
  • Glutanimate
    Glutanimate over 9 years
    @Harris as far as I know imagemagick can't handle vector graphics. Whatever you do, the output will always be a rasterized image.
  • Harris
    Harris over 9 years
    In their website they say that imagemagick uses inkscape or rsvg-convert to handle svg files.
  • Harris
    Harris over 9 years
    @MadMike, see modified solution above.
  • Glutanimate
    Glutanimate over 9 years
    @Harris Exactly, but that's the problem. rsvg-convert converts vector graphics into raster images. OP, though, wants to preserve the vector image.
  • MadMike
    MadMike over 9 years
    Almost works. I've tried pdfposter -m a3 -p 1x2a3 askUbuntu.pdf out.pdf the resulting PDF has a blue background (pdfposter 0.6.0) instead of white. You can test it yourself if you want. Download the source PDF here and repeat the conversion, please. Do you have the same result?
  • Keith
    Keith over 9 years
    @MadMike: I get the same blue background with your PDF (but a white one with mine). Did you also use 'Save as' in Inkscape to create the PDF? I noticed that in your PDF I can't select the text, whereas I can in mine. If I select the 'convert texts to paths' option in the PDF export options I get the same blue background as you do after using pdfposter. For completeness: I have the same version of pdfposter, and version 0.48.4 of Inkscape.
  • MadMike
    MadMike over 9 years
    Jup. Works perfectly. Not converting the text to path while saving to PDF makes the difference. Now I hope the font embedding is good enough for the printer. ;)
  • MadMike
    MadMike over 9 years
    I've updated the download link.
  • Michal Fapso
    Michal Fapso about 8 years
    Thanks, the pdfposter worked for me too. I just had to get its development version (gitlab.com/pdftools/pdfposter), because the one from the official Ubuntu repository (pdfposter 0.6.0-2) inverted black and white colors.