9

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.

  • Have a look at this question: Printing a poster (over several sheets of paper) – fret Nov 4 '14 at 22:41
  • You can use imagemagick (command convert) to crop the upper and lower parts of the image independently into two different pdf files. – Harris Nov 6 '14 at 23:13
  • For instance: convert filename.svg -crop 100%x50% +repage filename.pdf – Harris Nov 6 '14 at 23:29
  • @MadMike, Could you mention your current work flow? (ie How are you doing it manually?) – user.dz Nov 10 '14 at 5:25
  • 1
    @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. – MadMike Nov 10 '14 at 5:47
1
+50

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.

  • 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? – MadMike Nov 11 '14 at 22:20
  • @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. – ph0t0nix Nov 11 '14 at 22:34
  • 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 Nov 11 '14 at 23:01
  • 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. – Michal Fapso Apr 18 '16 at 20:48
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.

  • You can also try the following options to avoid the image getting rasterized: -density 600 -define psd:fit-page=2338x -resize 2338x – Harris Nov 7 '14 at 22:25
  • 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) – MadMike Nov 8 '14 at 7:57
  • Does this give you a rasterized pdf: convert -density 90 askUbuntu.svg -crop 50%x100% +repage -trim -background black askUbuntu.pdf – Harris Nov 8 '14 at 11:45
  • @Harris as far as I know imagemagick can't handle vector graphics. Whatever you do, the output will always be a rasterized image. – Glutanimate Nov 8 '14 at 12:49
  • In their website they say that imagemagick uses inkscape or rsvg-convert to handle svg files. – Harris Nov 8 '14 at 13:26
0

as I couldn't get your file (broken link) I managed with a PDF I had on my computer. Anyway, this is how I proceeded:

  • Launch Scribus (1.4.3 on Ubuntu 12.04 LTS)
  • create new A3 2 pages document with options "Double Page" and "Starting on left page" selected (maybe not the right translation as I'm working on a French Scribus version).
  • create an image frame over the two pages
  • import PDF
  • set image size fit to frame
  • export as PDF
  • print it

The result is in the archive you can download here: http://www.filedropper.com/2a3tar_1 (1.4 Mo)

The problem that can occur is related to technical margins desktop printers usually have.

In this case, you could make 2 images frames that overlap like in the 2A3bis.sla file provided.

  • I've updated the download link. – MadMike Nov 12 '14 at 23:53
0

SVG is an XML, you can use this python script to generate slices. Actually, it does not slice it, but uses same copy of input file with different values of viewBox to show only target area.

svg_slice.py

#!/usr/bin/env python

import sys, os.path
import xml.etree.ElementTree as ET

fin=sys.argv[-1]
hsplit=int(sys.argv[1])
vsplit=int(sys.argv[2])

tree = ET.parse(fin)
root = tree.getroot()

hstep=float(root.attrib['width'])/hsplit
vstep=float(root.attrib['height'])/vsplit

root.attrib['width']=str(hstep)
root.attrib['height']=str(vstep)

for i in range(hsplit):
    for j in range(vsplit):
        root.attrib['viewBox']='%.4f %.4f %.4f %.4f' % (i*hstep, j*vstep, hstep, vstep)
        tree.write('cell_%i-%i_%s' % (i,j,os.path.basename(fin)))
  1. Generate slices

    python svg_slice.py 2 1 askUbuntu.svg
    

    ie: 2x1 grid

  2. Then use Inkscape to export PDF for each slice/cell

    for i in $(ls cell_*); do inkscape $i --export-pdf=$i.pdf; done;
    

ls cell_*

cell_0-0_askUbuntu.svg      cell_1-0_askUbuntu.svg
cell_0-0_askUbuntu.svg.pdf  cell_1-0_askUbuntu.svg.pdf

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.