PDF export using command line in Linux - font problem

Using Inkscape with other software? Talk about it here.
jwright-adigi
Posts: 3
Joined: Wed Jan 25, 2012 6:39 am

PDF export using command line in Linux - font problem

Postby jwright-adigi » Wed Jan 25, 2012 7:19 am

Hi,

I'm using Inkscape to export an SVG as a PDF file. I have a script that uses PHP and executes the following command on my Linux server:

Code: Select all

inkscape svg/[SVG FILE NAME].svg --export-pdf=svg/[PDF FILE NAME].pdf --export-area-drawing


The SVG file contains shapes and text, everything is exported to the PDF successfully and the fonts appear to be embedded/subset correctly. The PDF opens in acrobat reader without any warnings and looks ok.

When I open/import the file with Adobe Illustrator, I get a warning saying "The font [ArialBoldMT] is missing. Affected text will be displayed using a substitute font.To preserve appearance, some text has been outlined."

This happens with any font used, i.e Arial, Times New Roman etc. The fonts I'm using in the SVG file are installed and cachced/shared within Linux. Also, the fonts I'm using are definitely installed on the machine I'm using Illustrator with - running Windows 7.

The same PDF will not open at all in Corel Draw X3 - I get an I/O error.

Oddly, if I run the same command on my windows machine from the command prompt (not through PHP) and open the exported PDF from this method in Illustrator, I do not get an error but the characters are replaced by boxes with crossed. If I open that file with Correct Draw, it opens without any issues!

There something very strange going on and I'd really appreciate some help and advice.

I have attached examples generated with Linux and Windows as described above.

Thanks
Attachments
linux_test.pdf
(16.85 KiB) Downloaded 328 times
windows_test.pdf
(13.6 KiB) Downloaded 391 times

jwright-adigi
Posts: 3
Joined: Wed Jan 25, 2012 6:39 am

Re: PDF export using command line in Linux - font problem

Postby jwright-adigi » Thu Jan 26, 2012 4:24 am

I should also mention that the version installed on Linux is 0.47 and on windows it's 0.48.

jwright-adigi
Posts: 3
Joined: Wed Jan 25, 2012 6:39 am

Re: PDF export using command line in Linux - font problem

Postby jwright-adigi » Fri Feb 03, 2012 9:09 am

From what I have found out, inkscape uses Cairo to generate its PDFs, so that is most likely to be the culprit.

Is there and easy way to find out what version of Cairo inkscape is using? If there is a later version available can this be updated on its own or dos Inkscape have to be rebuilt?

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: PDF export using command line in Linux - font problem

Postby ~suv » Fri Feb 03, 2012 9:48 am

jwright-adigi wrote:Is there and easy way to find out what version of Cairo inkscape is using?
Open a new document in Inkscape, draw a rectangle and save a copy as PS or EPS file. Then open the PostScript file in a plain-text editor: the version of cairo will be shown similar to this:

Code: Select all

%%Creator: cairo 1.10.2 (http://cairographics.org)
%%CreationDate: Thu Jan  5 20:34:43 2012

Alternatively, save a copy as PDF, open it in evince, and take a look at 'File > Properties' to see information about the producer and creator software used.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: PDF export using command line in Linux - font problem

Postby ~suv » Fri Feb 03, 2012 10:07 am

BTW - Evince 2.30.3 renders both PDFs flawlessy:
jwright-adigi-test-PDFs-Evince2.30.3.png
jwright-adigi-test-PDFs-Evince2.30.3.png (80.8 KiB) Viewed 5285 times


Both have the font 'Arial Bold' embedded - though with different generated names and font types - (i.e. they do not require to load the font from the system on which the PDF file is currently displayed - see the Release notes of Inkscape 0.47 for some details):

Code: Select all

$ pdffonts -v
pdffonts version 0.18.2
Copyright 2005-2011 The Poppler Developers - http://poppler.freedesktop.org
Copyright 1996-2004 Glyph & Cog, LLC
$
$ pdffonts jwright-adigi-linux_test.pdf
name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
ArialBold                            TrueType          yes no  no       7  0
$
$ pdffonts jwright-adigi-windows_test.pdf
name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
JNBUTZ+Arial-BoldMT                  CID TrueType      yes yes yes      5  0
$


Return to “Inkscape & other”