Letter "q" imported instead of a circle plot symbol in PDF import

Bug #190541 reported by TL
14
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Unassigned

Bug Description

When importing PDF files of scientific plots generated from R (www.r-project.org), the import filter replaces all circles and dots with the letter "q". The issue may be relevant to PDF import of files generated by other scientific plotting packages as well. The PDFs render correctly in Acrobat Reader.

Inkscape version tested: Inkscape 0.46-pre1
OS: Windows XP

To test, please see the attached example files. Initially I wasn't sure how to attach the files so I also placed a temporary link to the example PDF files. The linked files will be removed at some point in the future.

http://tribolaboy.googlepages.com/bugreport-1.pdf
http://tribolaboy.googlepages.com/bugreport-2.pdf
http://tribolaboy.googlepages.com/bugreport-3.pdf

Hope this can be easily fixed because it is major showstopper for many people, who use R and wish to make better use of Inkscape for plot annotation etc.

Regards,
TL

P.S. In case anyone is interested, to generate the files from scratch you would need R (www.r-project.org) installed and run the following:

---------<R code start>---------------
# plot 1
pdf(file="bugreport-1.pdf", onefile = FALSE, paper="a4", width = 18/2.54, height = 12/2.54)
library(lattice)
show.settings()
dev.off()

# plot 2
pdf(file="bugreport-2.pdf", onefile = FALSE, paper="a4", width = 18/2.54, height = 18/2.54)
with(iris, plot (Sepal.Length, Sepal.Width, pch = as.numeric(Species), cex = 1.2))
legend (6.1, 4.4, c("setosa", "versicolor", "virginica"), cex = 1.5, pch = 1:3)
dev.off()

# plot 3
pdf(file="bugreport-3.pdf", onefile = FALSE, paper="a4", width = 18/2.54, height = 18/2.54)
plot(1:25, pch = 1:25)
dev.off()
---------<R code end>---------------

Revision history for this message
TL (tribolaboy) wrote :
description: updated
Revision history for this message
TL (tribolaboy) wrote :
Revision history for this message
TL (tribolaboy) wrote :
Revision history for this message
JiHO (jiho) wrote :

What happens is that the pdf device of R uses a latter in a symbol font rather than a true circle to represent points in the PDF. See my email about this on R's list for details:
   https://stat.ethz.ch/pipermail/r-help/2007-October/142356.html
When Inkscape imports the PDF, it sees these letters as letters (and has no way to do otherwise) but if the font (ZapfDingbats) is not present on the system or if it is not accessible for Inkscape or if it is not the good version or... or... or... (this is a complicated mater) it just defaults to a regular font.

I consider this to be a bug in the pdf() device of R rather than in Inkscape actually, and a pretty severe one since it can lead to data mis-representation. However it was not really picked up on R's list. Several workarounds were proposed (see the link above), mine are:
- use package RSvgDevice to output to SVG
or better
- use package Cairo which can be used as a regular plotting device (much better than R's default in my opinion) or to produce PDFs or SVGs. In both formats the output is great and Inkscape deals with it perfectly.

I hope that helps. --JiHO

Changed in inkscape:
status: New → Invalid
Revision history for this message
TL (tribolaboy) wrote :

Hi,

Thanks for the information. It was extremely helpful. The RSvgDevice did not work for me, because some labels were not rendered. The Cairo device, however, works great for SVG (and Inkscape PDF import). So I guess this is not an Inkscape issue after all and can be closed. Sorry for the trouble.

TL

su_v (suv-lp)
tags: added: importing pdf
tags: added: fonts
Revision history for this message
ottadini (ben-harrison) wrote :

An alternative workaround is posted in https://bugs.launchpad.net/inkscape/+bug/668701:

Use pdf2svg to convert the pdf.

Revision history for this message
Jonathan Hofinger (jhofinger) wrote :

Hi, all three files are correctly imported in Inkscape 1.0, Windows 10.

Closing as fixed.

If you encounter any further issues, please report them to http://inkscape.org/report.

Closed by https://gitlab.com/jhofinger

Changed in inkscape:
status: Invalid → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.