# Exporting BarChart3D as PDF produces artefacts

So I think the following image already shows the problem, similar to Avoiding white lines inside filled area in RegionPlot exported as PDF or PS the pdf export of the chart creates thin lines in the plot. The fixing rule proposed in the related question seems not to work (sorry I am really new to mathematica). Disabling the Antialiasing doesnt improves the situation!

-

## Solution

The problem seems to be that the polygonal regions in the exported PDF file do not have edge strokes. It can be partially solved by reimporting the figure and correct this.

(* FILENAME.pdf contains an exported BarChart3D figure *)
(* 't' gives the desired edge thickness *)
chart = Import["FILENAME.pdf"];
chart = chart /. {FaceForm[n__] :> {FaceForm[n], EdgeForm[{Thickness[t], n}]}};
Export["NEW_FILENAME.pdf", chart];


I tested this code only for BarChart3D output. It seems that in the reimported figure all colored regions are defined by FilledCurves and all additional lines by JoinedCurves. Furthermore, a FaceForm definition is only found in the region declarations.

## Possible problem

Different PDF viewers seem to interpret a Thickness[n] declaration differently. This can be solved by replacing Thickness with AbsoluteThickness.

## Benefit

This solution preserves the vector graphics character of the chart in the exported PDF file. @Jens solution rasterizes the image and makes it resolution dependent.

-

To make nicer PDFs, you could adapt the answer here as follows. Before making any plots, execute the command

Map[SetOptions[#,
Prolog -> {{EdgeForm[], Texture[{{{0, 0, 0, 0}}}],
Polygon[#, VertexTextureCoordinates -> #] &[{{0, 0}, {1,
0}, {1, 1}}]}}] &, {Graphics3D, ContourPlot3D,
ListContourPlot3D, ListPlot3D, Plot3D, ListSurfacePlot3D,
ListVectorPlot3D, ParametricPlot3D, RegionPlot3D, RevolutionPlot3D,
SphericalPlot3D, VectorPlot3D, BarChart3D}];


and then do the BarChart3D. If you export it to PDF now, the process will take a little longer but the output will look nicer, without the lines. The explanation why this works is given in the linked answer. I only modified that trick by appending BarChart3D to the list of functions to which it applies.

-
great! works perfectly! thx! –  MrMuh Nov 16 '12 at 17:09