From kasperdanielhansen at gmail.com  Fri Mar 19 20:50:50 2010
From: kasperdanielhansen at gmail.com (Kasper Daniel Hansen)
Date: Fri, 19 Mar 2010 15:50:50 -0400
Subject: [Rd] Crash of latticeExtra graph with Adobe Acro
	Pro/Reader/Windows/ during print only (display ok).
In-Reply-To: <-7681016450204010050@unknownmsgid>
References: <-7681016450204010050@unknownmsgid>
Message-ID: <e780c0971003191250v478047a4s564ad995f992102f@mail.gmail.com>

Flattening usually has to do with converting transparent stuff when
you convert from a format that supports it (pdf) to something like
postscript.  At least that is the technical term used in Adobe
Illustrator.

This may be related to the fact the Adobe Illustrator from CS4 creates
bad postscript files from PDF/ai files containing transparency (at
least when they are created using R).  I don't think this is a problem
at all with R, rather it seems to be an illustrator problem (which I
think is a pretty amazing bug).  What I do with postscript files
produced with Illustrator is to post process them using the following
perl script:
  http://tomas.rokicki.com/illbug/fixill.pl
So my workflow is something like
  make pdf from R
  process the pdf using Illustrator, saving it as eps
  ./fixill.pl bad.eps > good.eps

Come to think of it, all files where I have experience this have had
1000+ points on them.

Kasper




On Fri, Mar 19, 2010 at 3:26 PM, Dieter Menne
<dieter.menne at menne-biomed.de> wrote:
> I created a report with Sweave today, that displayed perfectly on screen,
> but crashed both Adobe Pro 9.3.1 and Adobe Reader 9.0 on Windows 7. Output
> with Foxit Reader was flawless.
>
> I was able to reproduce a "minimal" example, which is not really minimal but
> the smallest I could get after 2 hours of wasting paper.
>
> Required:
>
> latticeExtra calling both
> ? ? ?panel.xyplot(...) # both lines are required, no problem with only one
> of them
> ? ? ?panel.smoother(...) #
>
> pch = 16 (lower number were no problem)
>
> At least 300 data points with some overlap; I did bracket it exactly, but
> 200 did not show the problem. I was not able to generate a runif-based
> example, therefore a simplified data set from my original report is
> included.
>
> Reproduce: Run the example. sessionInfo see below. Open the created pdf with
> Adobe Acrobat Pro/Reader. It displays perfectly.
>
> Print it to any device; I used the virtual Windows XPS printer because after
> 30 pages I was running out of laser printer toner.
>
> Adobe Displays: Flattening, and hangs after 94%; must be force-restarted
> after that.
>
> When using more data points, it hangs after a lower percentage; looks like
> "flattening" has to do with processing of data points, and 300 is just above
> the limit.
>
> My workaround is to use something else than pch=16, because I cannot force
> customers to install Foxit.
>
> The created pdf file can be downloaded from
> http://www.menne-biomed.de/uni/crashedadobe.pdf
>
> Dieter Menne
>
>
>
> library(latticeExtra)
>
> d = structure(list(y = c(1, 2, 0, 3, 2, 1, 2, 2, 1, 0, 1, 1, 1, 1,
> 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 0, 2, 2, 2, 2, 2, 1, 1, 2,
> 2, 3, 0, 2, 3, 1, 2, 2, 2, 2, 1, 0, 2, 1, 2, 4, 2, 1, 1, 0, 0,
> 1, 2, 2, 3, 1, 1, 2, 2, 2, 2, 1, 2, 0, 2, 0, 2, 2, 1, 1, 1, 1,
> 2, 1, 8, 2, 5, 3, 2, 2, 0, 1, 0, 2, 0, 2, 0, 2, 4, 2, 2, 2, 2,
> 2, 1, 2, 5, 1, 1, 2, 0, 1, 2, 2, 2, 2, 1, 2, 2, 0, 1, 2, 0, 2,
> 2, 2, 2, 1, 0, 2, 0, 1, 2, 1, 2, 2, 0, 0, 2, 2, 2, 3, 2, 2, 2,
> 2, 2, 1, 2, 1, 2, 2, 2, 2, 2), x = c(1, 2, 3, 13, 1, 14, 14,
> 4, 4, 0, 1, 1, 4, 2, 5, 3, 4, 13, 2, 5, 12, 1, 4, 0, 1, 2, 0,
> 2, 5, 2, 3, 3, 3, 1, 5, 4, 5, 0, 4, 2, 5, 4, 12, 3, 3, 5, 0,
> 3, 4, 4, 14, 5, 2, 1, 0, 0, 1, 3, 4, 2, 14, 1, 2, 2, 12, 1, 3,
> 4, 0, 5, 2, 5, 2, 2, 3, 5, 5, 2, 5, 13, 2, 4, 12, 2, 4, 1, 4,
> 0, 1, 0, 1, 0, 4, 5, 4, 5, 2, 2, 13, 3, 4, 13, 1, 12, 3, 1, 0,
> 2, 5, 3, 14, 4, 2, 2, 0, 0, 4, 0, 2, 12, 13, 3, 2, 1, 4, 2, 3,
> 1, 1, 3, 3, 0, 0, 3, 5, 3, 13, 3, 13, 3, 13, 3, 1, 1, 4, 2, 1,
> 4, 12, 5)), .Names = c("y", "x"),
> row.names = c(NA, -150L), class = "data.frame")
>
> pdf("crashedadobe.pdf")
> p2 = xyplot(y~x,data=d,
> ? ?pch=16, # required, no problem with pch=1,2,8
> ? ?panel = function(...) {
> ? ? ?panel.xyplot(...) # both lines are required
> ? ? ?panel.smoother(...) #
> ? ?},
> ?)
> print(p2)
> dev.off()
>
>
> #R version 2.10.1 (2009-12-14)
> #i386-pc-mingw32
> #
> #locale:
> #[1] LC_COLLATE=German_Germany.1252 ?LC_CTYPE=German_Germany.1252
> #[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
> #[5] LC_TIME=German_Germany.1252
> #
> #attached base packages:
> #[1] stats ? ? graphics ?grDevices datasets ?utils ? ? methods ? base
> #
> #loaded via a namespace (and not attached):
> #[1] tools_2.10.1
> #
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] Crash of latticeExtra graph with Adobe Acro Pro/Reader/Windows/ during print only (display ok).
Kasper Daniel Hansen